DEV Community

Discussion on: The useRef() hook in React!

Collapse
 
dommirr profile image
dommirr

I understand that it is an example of how to use useEffect, but I don't know if it is the best example.

Isn't it more expensive for React to save the multi-input references than to render multiple inputs controlled with a useState?

Collapse
 
ziratsu profile image
Ustariz Enzo

It depends if you want to use controlled or uncontrolled inputs.
I really don't think that there is a performance problem there :).