Why is the storage method of React Hook on the Fiber node a linked list instead of an array? What are the unique advantages of using a linked list?
This is a question I encountered during the interview and I didn't quite understand it。
Why is the storage method of React Hook on the Fiber node a linked list instead of an array? What are the unique advantages of using a linked list?
This is a question I encountered during the interview and I didn't quite understand it。
Copyright © 2021 Jogjafile Inc.
Linked list are better in traversal, insertion and deletion operation than the arrays which help virtual dom to manipulated states and components.
For more, just assume deletion of 0th index element in an array and in linked list both have different performance and react need to fast refresh of every component it will not wait for arrays insertion and deletion for mounting and un-mounting the component in Dom.
for more ->
First Fiber
Depth