Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Offscreen] Mount/unmount layout effects #21386

Merged
merged 2 commits into from
Jun 1, 2021

Commits on Jun 1, 2021

  1. [Offscreen] Mount/unmount layout effects

    Exposes the Offscreen component type and implements basic support for
    mount/unmounting layout effects when the visibility is toggled.
    
    Mostly it works the same way as hidden Suspense trees, which use the
    same internal fiber type. I had to add an extra bailout, though, that
    doesn't apply to the Suspense case but does apply to Offscreen
    components: a hidden Offscreen tree will eventually render at low
    priority, and when we it does, its `subtreeTag` will have effects
    scheduled on it. So I added a check to the layout phase where, if the
    subtree is hidden, we skip over the subtree entirely. An alternate
    design would be to clear the subtree flags in the render phase, but I
    prefer doing it this way since it's harder to mess up.
    
    We also need an API to enable the same thing for passive effects. This
    is not yet implemented.
    acdlite committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    bfea047 View commit details
    Browse the repository at this point in the history
  2. Add test starting from hidden

    rickhanlonii authored and acdlite committed Jun 1, 2021
    Configuration menu
    Copy the full SHA
    129640c View commit details
    Browse the repository at this point in the history