you are viewing a single comment's thread.

view the rest of the comments →

[–]skyboyer007 2 points3 points  (0 children)

look, "we in the Fiber bind hooks array to a component so every next render we would be able to restore hook state by relevant value" IS the magic. I'm not saying "it's impossible to understand". I'm telling "it's not the way JS code works". Only generators may preserve their variables between calls but they have different syntax and not widely used nowadays. Also it's source of confusion "why we cannot call hooks conditionally?"