DEV Community

Discussion on: The useRef() hook in React!

Collapse
 
annetawamono profile image
Anneta Wamono

Is it possible to use 1 ref across components that aren't in each other's hierarchy?

Collapse
 
ziratsu profile image
Ustariz Enzo

You need to instanciate one ref by component, you cannot share it;