We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
null
undefined
1 parent c1220eb commit 4e6eec6Copy full SHA for 4e6eec6
packages/shared/invokeGuardedCallbackImpl.js
@@ -81,7 +81,7 @@ if (__DEV__) {
81
// when we call document.createEvent(). However this can cause confusing
82
// errors: https://github.com/facebook/create-react-app/issues/3482
83
// So we preemptively throw with a better message instead.
84
- if (typeof document === 'undefined') {
+ if (typeof document === 'undefined' || document === null) {
85
throw new Error(
86
'The `document` global was defined when React was initialized, but is not ' +
87
'defined anymore. This can happen in a test environment if a component ' +
0 commit comments