Skip to content

Commit 6e3bc8a

Browse files
authored
[DevTools] Check if Proxy exists before creating DispatcherProxy (#25278)
1 parent 8951c5f commit 6e3bc8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/react-debug-tools/src/ReactDebugHooks.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ const DispatcherProxyHandler = {
367367
},
368368
};
369369

370-
const DispatcherProxy = new Proxy(Dispatcher, DispatcherProxyHandler);
370+
// `Proxy` may not exist on some platforms
371+
const DispatcherProxy =
372+
typeof Proxy === 'undefined'
373+
? Dispatcher
374+
: new Proxy(Dispatcher, DispatcherProxyHandler);
371375

372376
// Inspect
373377

0 commit comments

Comments
 (0)