Skip to content

Commit 900a7af

Browse files
committed
Make nativeFabricUIManager optional
1 parent b0671f9 commit 900a7af

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import getComponentNameFromType from 'shared/getComponentNameFromType';
4747
const {
4848
dispatchCommand: fabricDispatchCommand,
4949
sendAccessibilityEvent: fabricSendAccessibilityEvent,
50-
} = nativeFabricUIManager;
50+
} = global.nativeFabricUIManager ? global.nativeFabricUIManager : {};
5151

5252
const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
5353

packages/react-native-renderer/src/ReactFabricGlobalResponderHandler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
// Module provided by RN:
1111
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
1212

13-
const {setIsJSResponder} = nativeFabricUIManager;
13+
const {setIsJSResponder} = global.nativeFabricUIManager
14+
? global.nativeFabricUIManager
15+
: {};
1416

1517
const ReactFabricGlobalResponderHandler = {
1618
onChange: function(from: any, to: any, blockNativeResponder: boolean) {

packages/react-native-renderer/src/ReactNativeFiberInspector.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ if (__DEV__) {
2626
Object.freeze(emptyObject);
2727
}
2828

29-
const {measure, findNodeAtPoint} = nativeFabricUIManager;
29+
const {measure, findNodeAtPoint} = global.nativeFabricUIManager
30+
? global.nativeFabricUIManager
31+
: {};
3032

3133
let createHierarchy;
3234
let getHostNode;

packages/react-native-renderer/src/ReactNativeRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
5252
const {
5353
sendAccessibilityEvent: fabricSendAccessibilityEvent,
5454
dispatchCommand: fabricDispatchCommand,
55-
} = nativeFabricUIManager;
55+
} = global.nativeFabricUIManager ? global.nativeFabricUIManager : {};
5656

5757
function findHostInstance_DEPRECATED(
5858
componentOrHandle: any,

0 commit comments

Comments
 (0)