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

Support disabling spurious act warnings with a global environment flag #22561

Merged
merged 2 commits into from
Oct 18, 2021

Commits on Oct 14, 2021

  1. Extract act environment check into function

    `act` checks the environment to determine whether to fire a warning.
    We're changing how this check works in React 18. As a first step, this
    refactors the logic into a single function. No behavior changes yet.
    acdlite committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    c677938 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2021

  1. Use IS_REACT_ACT_ENVIRONMENT to disable warnings

    If `IS_REACT_ACT_ENVIRONMENT` is set to `false`, we will suppress
    any `act` warnings. Otherwise, the behavior of `act` is the same as in
    React 17: if `jest` is defined, it warns.
    
    In concurrent mode, the plan is to remove the `jest` check and only warn
    if `IS_REACT_ACT_ENVIRONMENT` is true. I have not implemented that
    part yet.
    acdlite committed Oct 18, 2021
    Configuration menu
    Copy the full SHA
    5a0bbca View commit details
    Browse the repository at this point in the history