React·100 questions

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?

More questions in this topic

Related questions from other topics