Skip to content

Commit 4f75709

Browse files
Mehdi Mulanifacebook-github-bot
Mehdi Mulani
authored andcommitted
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
1 parent 88ccb33 commit 4f75709

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Libraries/ReactNative/UIManager.js

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ UIManager.getViewManagerConfig = function(viewManagerName: string) {
5757
return config;
5858
}
5959

60+
// If we're in the Chrome Debugger, let's not even try calling the sync
61+
// method.
62+
if (__DEV__) {
63+
if (!global.nativeCallSyncHook) {
64+
return config;
65+
}
66+
}
67+
6068
if (UIManager.lazilyLoadView && !triedLoadingConfig.has(viewManagerName)) {
6169
const result = UIManager.lazilyLoadView(viewManagerName);
6270
triedLoadingConfig.add(viewManagerName);

0 commit comments

Comments
 (0)