React·100 questions

How to work with event handler lifting?

Answer
Handler is stored higher where state exists.
Child component calls props.onAction(data).
Simplifies testing.
Don't pass too many callbacks — group actions.
For complex scenarios, use reducer.
Was this answer helpful?

More questions in this topic

Related questions from other topics