mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Throw when act is used in production (#21686)
Upgrades the deprecation warning to a runtime error. I did it this way instead of removing the export so the type is the same in both builds. It will get dead code eliminated regardless.
This commit is contained in:
1 parent
a0d2d1e1e1
commit
bd0a963445
15 files changed
+87
-92
No files matched your search
@@ -35,16 +35,6 @@ module.exports = function shouldIgnoreConsoleError(format, args) {
|
||||
// They are noisy too so we'll try to ignore them.
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
format.indexOf(
|
||||
'act(...) is not supported in production builds of React'
|
||||
) === 0
|
||||
) {
|
||||
// We don't yet support act() for prod builds, and warn for it.
|
||||
// But we'd like to use act() ourselves for prod builds.
|
||||
// Let's ignore the warning and #yolo.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Looks legit
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user