← BYTES
React.js·Starter·Ref: 4.1.13
In React, how do you typically respond to a button click?
Have a question about this video? Mention reference 4.1.13 when you contact us.
a.By writing `onclick="..."` as a plain HTML string attribute
b.By passing a function to the `onClick` prop, e.g. `<button onClick={handleClick}>`
c.Clicks cannot be handled in React at all
d.By polling the DOM every second to check if the button was clicked
React event handlers are passed as props using camelCase names like `onClick`, and the value is a function reference (not a string), which React invokes when the event fires.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES4113#Reactjs