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

allow nested act()s from different renderers #16039

Merged
merged 2 commits into from Jul 2, 2019

Commits on Jul 2, 2019

  1. allow nested act()s from different renderers

    There are usecases where multiple renderers need to oprate inside an act() scope
    - ReactDOM.render being used inside another component tree. The parent component will be rendered using ReactTestRenderer.create for a snapshot test or something.
    - a ReactDOM instance interacting with a ReactTestRenderer instance (like for the new devtools)
    
    This PR changes the way the acting sigils operate to allow for this. It keeps 2 booleans, one attached to React, one attached to the renderer. act() changes these values, and the workloop reads them to decide what warning to trigger.
    
    I also renamed shouldWarnUnactedUpdates to warnsIfNotActing
    threepointone committed Jul 2, 2019
    Copy the full SHA
    d0f7be4 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    c0ab465 View commit details
    Browse the repository at this point in the history