Complete onClick Handler
Fill in the Blank Easy
Question
Fill in the blank to call setCount when the button is clicked.
Code
<button _____={() => setCount(count + 1)}>Increment</button>
Hint
React event props use camelCase.
Explanation
onClick is the React event handler prop for click events. It takes a function that is called when the element is clicked. React uses camelCase for all event handler props.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.