react/scripts/rollup/validate
Andrew Clark 163e81c1f8
Support disabling spurious act warnings with a global environment flag (#22561)
* 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.

* 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.
2021-10-18 08:27:26 -07:00
..
eslintrc.cjs.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
eslintrc.cjs2015.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
eslintrc.esm.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
eslintrc.fb.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
eslintrc.rn.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
eslintrc.umd.js Support disabling spurious act warnings with a global environment flag (#22561) 2021-10-18 08:27:26 -07:00
index.js [build2 -> build] Local scripts 2021-09-21 15:14:09 -04:00