Skip to content

Commit

Permalink
Make nativeFabricUIManager optional
Browse files Browse the repository at this point in the history
  • Loading branch information
sammy-SC committed Jan 30, 2023
1 parent b0671f9 commit 900a7af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import getComponentNameFromType from 'shared/getComponentNameFromType';
const {
dispatchCommand: fabricDispatchCommand,
sendAccessibilityEvent: fabricSendAccessibilityEvent,
} = nativeFabricUIManager;
} = global.nativeFabricUIManager ? global.nativeFabricUIManager : {};

const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
// Module provided by RN:
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';

const {setIsJSResponder} = nativeFabricUIManager;
const {setIsJSResponder} = global.nativeFabricUIManager
? global.nativeFabricUIManager
: {};

const ReactFabricGlobalResponderHandler = {
onChange: function(from: any, to: any, blockNativeResponder: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ if (__DEV__) {
Object.freeze(emptyObject);
}

const {measure, findNodeAtPoint} = nativeFabricUIManager;
const {measure, findNodeAtPoint} = global.nativeFabricUIManager
? global.nativeFabricUIManager
: {};

let createHierarchy;
let getHostNode;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactNativeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
const {
sendAccessibilityEvent: fabricSendAccessibilityEvent,
dispatchCommand: fabricDispatchCommand,
} = nativeFabricUIManager;
} = global.nativeFabricUIManager ? global.nativeFabricUIManager : {};

function findHostInstance_DEPRECATED(
componentOrHandle: any,
Expand Down

0 comments on commit 900a7af

Please sign in to comment.