Skip to main content

Self review: Dynamic events - React Basic

Updated 1 min readMarkdown
Part of seriesReact Basics
Self review: Dynamic events - React Basic
  1. In React, you are not allowed to code a separate function that should be run to handle a click event.

    • True

    • False

  2. Event-handling attributes in React are named almost the same as in HTML. Syntactically, the only difference is in the capitalization.

    • True

    • False

  3. What's wrong with this code?

     <button onClick={handleClick()}>
       Click me
     </button>
    
    • This code should work.

    • You cannot invoke an event-handling function from a JSX expression.

    • The event-handling attribute should be all lowercased.

About the author

No comments yet. Be the first to comment.

React Basics

Part 12 of 18

In this module you will explore the basic structure and use of the React.js library. You will learn how to produce single page web applications using React components and to use JSX to style them.

Up nextKnowledge check: Events and errors - React BasicWhen handling a click event in react, you should use the following attribute: Onclick OnClick on-click onClick Inside a JSX element, you can assign a JSX expression to the onClick handler to handle a click in React. False True You can pla...

More from this blog