Skip to main content

Event Handling in React

Learn Event Handling in React (Fundamentals of React, ReactJS) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Handling Events in React • React events are named using camelCase ( onClick , onChange , onSubmit ) rather than lowercase HTML attribute names. • You pass a function as the handler, not a string of code — onClick={handleClick} , not onClick="handleClick()" . • React wraps native browser events in a SyntheticEvent — a cross-browser wrapper that behaves consistently no matter which browser is running the code.

More lessons in Fundamentals of React