Skip to content

Commit da11356

Browse files
committed
Merge pull request #5166 from spicyj/gh-5157
Add feature test for document.createEvent
2 parents 4f9fdee + 1206d8d commit da11356

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shared/utils/ReactErrorUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ if (__DEV__) {
6161
* real browser event.
6262
*/
6363
if (typeof window !== 'undefined' &&
64-
typeof window.dispatchEvent === 'function') {
64+
typeof window.dispatchEvent === 'function' &&
65+
typeof document !== 'undefined' &&
66+
typeof document.createEvent === 'function') {
6567
var fakeNode = document.createElement('react');
6668
ReactErrorUtils.invokeGuardedCallback = function(name, func, a, b) {
6769
var boundFunc = func.bind(null, a, b);

0 commit comments

Comments
 (0)