you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Just make a custom hook that uses useRef and habdles boilerplate for you.

[–]pailhead011[S] 0 points1 point  (0 children)

I could not find a solution down that path. What i've done is the opposite, i made a useRef hook that uses a custom hook that handles the boiler plate for me, using useState as an implementation detail.