Event Handler Naming
Question
What is the conventional name for a click event handler?
Hint
Event handlers use handle + EventName in camelCase.
Explanation
The convention is to name event handlers as handle + EventName in camelCase: handleClick, handleChange, handleSubmit. The JSX attribute uses on + EventName: onClick={handleClick}. This naming clearly distinguishes the handler function from the event attribute. For component events (custom), use on + EventName for the prop and handle + EventName for the handler: <Child onDataUpdate={handleDataUpdate} />.
Related Resources
Related Lessons
- Event Handling
Learn events.
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.