DEV Community

Discussion on: Linked lists in the wild: React Hooks

Collapse
 
madhuvanth_g profile image
Madhuvanth Gopalan

Thanks for this post, Conlin. I've a question, maybe a naive one. Am trying to reason about why Hooks need a Linked list implementation. One usecase (useCase? ;)) it definitely seems to facilitate is, share state of one Hook to another. Curious to hear your thought process on this.

Collapse
 
madhuvanth_g profile image
Madhuvanth Gopalan

Maybe also to run all the effects one after another.

Collapse
 
madhuvanth_g profile image
Madhuvanth Gopalan

Ignore this naive question. I think, I figured out. Linked List allows React to rely on the order of Hooks calls which means, it could preserve state between re-renders.