We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
null
undefined
1 parent f25930c commit 4c7ce20Copy full SHA for 4c7ce20
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