Skip to content

Commit 1dd1a6d

Browse files
committed
fix[devtools]: feature-check document with typeof instead of direct reference
1 parent 5a97093 commit 1dd1a6d

File tree

1 file changed

+4
-1
lines changed
  • packages/react-devtools-shared/src/backend/views/Highlighter

1 file changed

+4
-1
lines changed

packages/react-devtools-shared/src/backend/views/Highlighter/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export default function setupHighlighter(
9797
}
9898

9999
// $FlowFixMe[method-unbinding]
100-
if (document && typeof document.addEventListener === 'function') {
100+
if (
101+
typeof document === 'object' &&
102+
typeof document.addEventListener === 'function'
103+
) {
101104
document.addEventListener('scroll', () => {
102105
if (!scrollTimer) {
103106
// Periodically synchronize the scroll while scrolling.

0 commit comments

Comments
 (0)