Post

Something I'd love demystified about #react... How does any particular useState() function know what it's associated parent component is? I haven't found a single way for JS to its parent or child functions, which I assume would be need to form those connections under-the-hood.

React uses an internal "Fiber" data structure, one per every component instance. Those store the current props, state, and hooks. All components (class, function) are facades over the Fiber data, and all forms of state queue the same rendering mechanism: blog.isquaredsoftware.com/2020/05/blog...

blog.isquaredsoftware.comBlogged Answers: A (Mostly) Complete Guide to React Rendering BehaviorDetails on how React rendering behaves, and how use of Context and React-Redux affect rendering

No replies yet.