File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,9 +227,11 @@ const bundles = [
227227 } ,
228228 entry : 'src/renderers/native/ReactNative.js' ,
229229 externals : [
230+ 'ExceptionsManager' ,
230231 'InitializeCore' ,
231232 'RCTEventEmitter' ,
232233 'UIManager' ,
234+ 'View' ,
233235 'deepDiffer' ,
234236 'flattenStyle' ,
235237 'TextInputState' ,
Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ var findNodeHandle = require('findNodeHandle');
2121
2222var ReactNative ;
2323
24- // TODO: figure this out when we work on flat bundles in RN.
25- // This might not be needed after all.
24+ // Works around a circular dependency in flat bundle.
2625function injectReactNative ( RN : $FlowFixMe ) {
2726 ReactNative = RN ;
2827}
@@ -159,7 +158,6 @@ var NativeMethodsMixin = {
159158 TextInputState. blurTextInput ( ReactNative . findNodeHandle ( this ) ) ;
160159 } ,
161160
162- // Temporary hack to avoid a circular dependency
163161 __injectReactNative : injectReactNative ,
164162} ;
165163
Original file line number Diff line number Diff line change 1212
1313var ReactNativeFeatureFlags = require ( 'ReactNativeFeatureFlags' ) ;
1414var NativeMethodsMixin = require ( 'NativeMethodsMixin' ) ;
15+ var takeSnapshot = require ( 'takeSnapshot' ) ;
1516
1617var ReactNative = ReactNativeFeatureFlags . useFiber
1718 ? require ( 'ReactNativeFiber' )
1819 : require ( 'ReactNativeStack' ) ;
1920
21+ // Work around circular dependencies
2022NativeMethodsMixin . __injectReactNative ( ReactNative ) ;
23+ takeSnapshot . __injectReactNative ( ReactNative ) ;
2124
2225ReactNative . __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
2326 createReactNativeComponentClass : require ( 'createReactNativeComponentClass' ) ,
Original file line number Diff line number Diff line change 1111 */
1212'use strict' ;
1313
14- var ReactNative = require ( 'ReactNative' ) ;
1514var UIManager = require ( 'UIManager' ) ;
1615
16+ var ReactNative ;
17+
18+ // Works around a circular dependency in flat bundle.
19+ function injectReactNative ( RN : $FlowFixMe ) {
20+ ReactNative = RN ;
21+ }
22+
1723import type { Element } from 'React' ;
1824
1925/**
@@ -51,4 +57,6 @@ function takeSnapshot(
5157 return UIManager . __takeSnapshot ( view , options) ;
5258}
5359
60+ takeSnapshot . __injectReactNative = injectReactNative ;
61+
5462module . exports = takeSnapshot ;
You can’t perform that action at this time.
0 commit comments