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

Flush all passive destroy fns before calling create fns #17947

Merged
merged 2 commits into from
Feb 11, 2020

Commits on Feb 11, 2020

  1. Flush all passive destroy fns before calling create fns

    Previously we only flushed destroy functions for a single fiber.
    
    The reason this is important is that interleaving destroy/create effects between sibling components might cause components to interfere with each other (e.g. a destroy function in one component may unintentionally override a ref value set by a create function in another component).
    
    This PR builds on top of the recently added deferPassiveEffectCleanupDuringUnmount kill switch to separate passive effects flushing into two separate phases (similar to layout effects).
    Brian Vaughn committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    ad04363 View commit details
    Browse the repository at this point in the history
  2. Change passive effect flushing to use arrays instead of lists

    This change offers a small advantage over the way we did things previous: it continues invoking destroy functions even after a previous one errored.
    Brian Vaughn committed Feb 11, 2020
    Configuration menu
    Copy the full SHA
    9ca1b2d View commit details
    Browse the repository at this point in the history