How to handle events correctly in React?
Answer
•Events are SyntheticEvent (most cases).
•Use onClick/onChange, etc.
•Don't call handler immediately: onClick={() => ...}.
•For performance, define handler in a function.
•Remember about bubbling and stopPropagation.
Was this answer helpful?