React·100 questions

What is useImperativeHandle and should you use it?

Answer
Allows customizing the ref API.
Useful for controls (focus, reset).
This is an imperative approach, use rarely.
Prefer declarative props.
If used — document the methods.
Was this answer helpful?

More questions in this topic

Related questions from other topics