Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid calling lazilyLoadView when running in the debugger
Summary:
@public
The Chrome debugger can't handle synchronous method calls, so we should avoid doing them.
Double wrapped the if with a DEV check so that it's removed when bundling in non-dev mode.

Reviewed By: fkgozali

Differential Revision: D10345056

fbshipit-source-id: 7a7a2c73f089693da5edafdf3ecf7a3e5d767e52
  • Loading branch information
Mehdi Mulani authored and facebook-github-bot committed Oct 12, 2018
1 parent 88ccb33 commit 4f75709
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Libraries/ReactNative/UIManager.js
Expand Up @@ -57,6 +57,14 @@ UIManager.getViewManagerConfig = function(viewManagerName: string) {
return config;
}

// If we're in the Chrome Debugger, let's not even try calling the sync
// method.
if (__DEV__) {
if (!global.nativeCallSyncHook) {
return config;
}
}

if (UIManager.lazilyLoadView && !triedLoadingConfig.has(viewManagerName)) {
const result = UIManager.lazilyLoadView(viewManagerName);
triedLoadingConfig.add(viewManagerName);
Expand Down

0 comments on commit 4f75709

Please sign in to comment.