Skip to content

Commit

Permalink
[DevTools] Check if Proxy exists before creating DispatcherProxy (#25278
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tyao1 authored Sep 16, 2022
1 parent 8951c5f commit 6e3bc8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/react-debug-tools/src/ReactDebugHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ const DispatcherProxyHandler = {
},
};

const DispatcherProxy = new Proxy(Dispatcher, DispatcherProxyHandler);
// `Proxy` may not exist on some platforms
const DispatcherProxy =
typeof Proxy === 'undefined'
? Dispatcher
: new Proxy(Dispatcher, DispatcherProxyHandler);

// Inspect

Expand Down

0 comments on commit 6e3bc8a

Please sign in to comment.