-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Description
Unmounting can take significant and unbounded time when we traverse the tree and call the life-cycles. This is the smallest problem of incremental reconciliation (out of: mount at arbitrary location > update a boundary > mount a boundary > unmount).
The theory is that we can remove the node from the tree first and then call the life-cycles later on during idle time. This means that the refs won't have access to nodes that are in the document anymore so reading any such information would no longer work.
This problem space might also be related to animations. Exit animations want a component/node to exist in the tree for as long as it needs to finish its animation offscreen, asynchronously get deleted from the tree and eventually get cleaned up by calling the unmount life-cycles.