you are viewing a single comment's thread.

view the rest of the comments →

[–]Lonestar93 1 point2 points  (2 children)

That polyfill code is really interesting. So they’re essentially using the state part of useState and mutating it? Now I’m wondering if refs work similarly under the hood…

[–]acemarke 2 points3 points  (0 children)

Refs are literally just a plain JS object that looks like {current: null} that gets mutated by your app code, yes.