mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
88ccb33b7d
commit
4f757095a8
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user