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:
Andrew Clark authored and GitHub committed 2021-06-16 16:29:51 -04:00
1 parent a0d2d1e1e1
commit bd0a963445
15 files changed
+87 -92

No files matched your search

+2 -1
View File
@@ -393,5 +393,6 @@
"402": "The depth must equal at least at zero before reaching the root. This is a bug in React.",
"403": "Tried to pop a Context at the root of the app. This is a bug in React.",
"404": "Invalid hook call. Hooks can only be called inside of the body of a function component.",
"405": "hydrateRoot(...): Target container is not a DOM element."
"405": "hydrateRoot(...): Target container is not a DOM element.",
"406": "act(...) is not supported in production builds of React."
}