forked from facebook/react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Visibility flag for hiding/unhiding trees (facebook#20043)
* Add Visibility flag for hiding/unhiding trees There's `beforeblur` logic in the snapshot phase that needs to visit every Suspense boundary whose visibility is toggled. Right now it does that by visiting Placement and Deletion effects. That includes many unrelated nodes. By adding a new flag specifically for toggling Visibility, we will only visit the relevant Suspense (and Offscreen) boundaries, instead of all nodes that have a Placement. Potential follow-ups (not urgent): - The `beforeblur` logic also has a check to see whether the visibility was toggled on or off. It only cares about things being hidden. As a follow up, I can split the Visibility flag into separate Hide/Show flags, and only visit Hide. - Now that this is separate from Update, we can move the rest of the Suspense's layout effects (like attaching retry listeners) to the passive phase. * Gate behind createEventHandle feature flag Only need to visit deleted and hidden trees during the snapshot phase if the experimental `createEventHandle` flag is enabled. Currently, it's only used internally at Facebook, not open source.
- Loading branch information
Showing
3 changed files
with
52 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters