DEV Community

Discussion on: Concrete example for React.useImperativeHandle

Collapse
 
poeticgeek profile image
Yoav Niran

The simple answer is yes. You can use it just like any other ref.

Architecturally, I'm not sure that's the best approach. As you (or someone else) may end up changing the "API" of the obj you assign the ref in one side without realizing its effect on its sibling.
In general, I don't think you want to build dependencies between sibling components this way.