Skip to main content

Command Palette

Search for a command to run...

Self review: Dynamic events - React Basic

Updated
1 min read
Self review: Dynamic events - React Basic
D

A passionate full-stack developer from @ePlus.DEV

  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.

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 next

Knowledge check: Events and errors - React Basic

When 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

E

ePlus.DEV - Exploring Technology with David Nguyen

1232 posts

A passionate full-stack developer from VIETNAM.