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

Refactor "reappear" logic into its own traversal #21898

Merged
merged 1 commit into from
Jul 16, 2021

Commits on Jul 16, 2021

  1. Refactor "reappear" logic into its own traversal

    When a Suspense boundary switches to its fallback state — or similarly,
    when an Offscreen boundary switches from visible to hidden — we unmount
    all its layout effects. When it resolves — or when Offscreen switches
    back to visible — we mount them again. This "reappearing" logic
    currently happens in the same commit phase traversal where we perform
    normal layout effects.
    
    I've changed it so that the "reappear" logic happens in its own
    recurisve traversal that is separate from the commit phase one.
    
    In the next step, I will do the same for the "disappear" logic that
    currently lives in the `hideOrUnhideAllChildren` function.
    
    There are a few reasons to model it this way, related to future
    Offscreen features that we have planned. For example, we intend to
    provide an imperative API to "appear" and "reappear" all the effects
    within an Offscreen boundary. This API would be called from outside the
    commit phase, during an arbitrary event. Which means it can't rely on
    the regular commit phase — it's not part of a commit. This isn't the
    only motivation but it illustrates why the separation makes sense.
    acdlite committed Jul 16, 2021
    Configuration menu
    Copy the full SHA
    5a16916 View commit details
    Browse the repository at this point in the history