Skip to content

Commit d543a5e

Browse files
statmM-i-k-e-l
authored andcommitted
Correctly bypass sync calls in UIManager during remote debugging (facebook#25162)
Summary: Remote debugging stopped working (since 0.58, according to facebook#23254). See facebook#23254 (comment) for repro steps. The root cause is incorrect checks for Chrome debugging environment in `UIManager.js`. - In one place where sync function `lazilyLoadView` should be avoided, we effectively use `if (__DEV__ && !global.nativeCallSyncHook)` to check remote debugging, which misses ship flavor (i.e. `__DEV__` is false). - In another place where we want to pre-populate view managers' constants to avoid calling sync function `getConstantsForViewManager`, `if (__DEV__)` is used, also missing ship flavor. This PR fixes both checks, only using the absense of `global.nativeCallSyncHook` to determine remote debugging environments. ## Changelog [JavaScript] [Fixed] - Correctly bypass sync calls in UIManager during remote debugging Pull Request resolved: facebook#25162 Differential Revision: D15692492 Pulled By: cpojer fbshipit-source-id: 173b688f140916b767fcdbbaaf68a5c303adbcd1
1 parent cf38912 commit d543a5e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Libraries/ReactNative/UIManager.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ const UIManagerJS: UIManagerJSInterface = {
7878

7979
// If we're in the Chrome Debugger, let's not even try calling the sync
8080
// method.
81-
if (__DEV__) {
82-
if (!global.nativeCallSyncHook) {
83-
return config;
84-
}
81+
if (!global.nativeCallSyncHook) {
82+
return config;
8583
}
8684

8785
if (
@@ -182,7 +180,7 @@ if (Platform.OS === 'ios') {
182180
}
183181
}
184182

185-
if (__DEV__) {
183+
if (!global.nativeCallSyncHook) {
186184
Object.keys(getConstants()).forEach(viewManagerName => {
187185
if (!UIManagerProperties.includes(viewManagerName)) {
188186
if (!viewManagerConfigs[viewManagerName]) {

0 commit comments

Comments
 (0)