Daniel Zuzevich
1 min readMar 3, 2020

--

I think setting state for each piece individually is causing a ton of re-renders and screwing something up. I would recommend trying doing it how I do in my example. Put everything into one useState object.

It doesn’t matter if you call the object “state” and the updater function “setState”. You can name it whatever, like const [slider, setSlider] = useState({}) blah blah blah. You get it.

--

--

Responses (1)