mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Hack around to fix RN bundle
This commit is contained in:
@@ -227,9 +227,11 @@ const bundles = [
|
||||
},
|
||||
entry: 'src/renderers/native/ReactNative.js',
|
||||
externals: [
|
||||
'ExceptionsManager',
|
||||
'InitializeCore',
|
||||
'RCTEventEmitter',
|
||||
'UIManager',
|
||||
'View',
|
||||
'deepDiffer',
|
||||
'flattenStyle',
|
||||
'TextInputState',
|
||||
|
||||
@@ -21,8 +21,7 @@ var findNodeHandle = require('findNodeHandle');
|
||||
|
||||
var ReactNative;
|
||||
|
||||
// TODO: figure this out when we work on flat bundles in RN.
|
||||
// This might not be needed after all.
|
||||
// Works around a circular dependency in flat bundle.
|
||||
function injectReactNative(RN: $FlowFixMe) {
|
||||
ReactNative = RN;
|
||||
}
|
||||
@@ -159,7 +158,6 @@ var NativeMethodsMixin = {
|
||||
TextInputState.blurTextInput(ReactNative.findNodeHandle(this));
|
||||
},
|
||||
|
||||
// Temporary hack to avoid a circular dependency
|
||||
__injectReactNative: injectReactNative,
|
||||
};
|
||||
|
||||
|
||||
@@ -12,12 +12,15 @@
|
||||
|
||||
var ReactNativeFeatureFlags = require('ReactNativeFeatureFlags');
|
||||
var NativeMethodsMixin = require('NativeMethodsMixin');
|
||||
var takeSnapshot = require('takeSnapshot');
|
||||
|
||||
var ReactNative = ReactNativeFeatureFlags.useFiber
|
||||
? require('ReactNativeFiber')
|
||||
: require('ReactNativeStack');
|
||||
|
||||
// Work around circular dependencies
|
||||
NativeMethodsMixin.__injectReactNative(ReactNative);
|
||||
takeSnapshot.__injectReactNative(ReactNative);
|
||||
|
||||
ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
createReactNativeComponentClass: require('createReactNativeComponentClass'),
|
||||
|
||||
@@ -11,9 +11,15 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ReactNative = require('ReactNative');
|
||||
var UIManager = require('UIManager');
|
||||
|
||||
var ReactNative;
|
||||
|
||||
// Works around a circular dependency in flat bundle.
|
||||
function injectReactNative(RN: $FlowFixMe) {
|
||||
ReactNative = RN;
|
||||
}
|
||||
|
||||
import type {Element} from 'React';
|
||||
|
||||
/**
|
||||
@@ -51,4 +57,6 @@ function takeSnapshot(
|
||||
return UIManager.__takeSnapshot(view, options);
|
||||
}
|
||||
|
||||
takeSnapshot.__injectReactNative = injectReactNative;
|
||||
|
||||
module.exports = takeSnapshot;
|
||||
|
||||
Reference in New Issue
Block a user