DEV Community

Discussion on: Don't be too dependent on useState, useRef is there for you

Collapse
 
svbofficial1 profile image
SVB_official

Why can't you use the single object in useState? In this case you will avoid 'the horrible performance bottleneck' because you will have only 1 re-render in this way.

Collapse
 
sakethkowtha profile image
sakethk • Edited

Re-rendering will happen once we update the state. Even if we use single state object or multiple state variables it will be same. I guess it wont help 🤔