diff --git a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap index 54d4e46fd90..c324b68b283 100644 --- a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap +++ b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap @@ -22,7 +22,7 @@ interface NativeCommands { +scrollTo: (viewRef: React.ElementRef, y: Int32, animated: boolean) => void, } -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); const { dispatchCommand @@ -84,7 +84,7 @@ interface NativeCommands { +scrollTo: (viewRef: React.ElementRef, y: Int32, animated: boolean) => void, } -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); const { dispatchCommand diff --git a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js index a95cce35fe0..8a16c674275 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js +++ b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js @@ -177,7 +177,7 @@ function buildViewConfig( switch (extendProps.knownTypeName) { case 'ReactNativeCoreViewProps': imports.add( - "const NativeComponentRegistry = require('NativeComponentRegistry');", + "const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');", ); return; diff --git a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap index 099c42e270f..cf218e0b23e 100644 --- a/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap +++ b/packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateViewConfigJs-test.js.snap @@ -16,7 +16,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ArrayPropsNativeComponent'; @@ -61,7 +61,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ArrayPropsNativeComponent'; @@ -92,7 +92,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'BooleanPropNativeComponent'; @@ -123,7 +123,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ColorPropNativeComponent'; @@ -156,7 +156,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); const {dispatchCommand} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); let nativeComponentName = 'CommandNativeComponent'; @@ -195,7 +195,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); const {dispatchCommand} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); let nativeComponentName = 'CommandNativeComponent'; @@ -237,7 +237,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'DoublePropNativeComponent'; @@ -273,7 +273,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'EventsNestedObjectNativeComponent'; @@ -314,7 +314,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'EventsNativeComponent'; @@ -375,7 +375,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'RCTInterfaceOnlyComponent'; @@ -433,7 +433,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ExcludedAndroidComponent'; @@ -461,7 +461,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ExcludedAndroidIosComponent'; @@ -489,7 +489,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'FloatPropNativeComponent'; @@ -525,7 +525,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ImagePropNativeComponent'; @@ -558,7 +558,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'InsetsPropNativeComponent'; @@ -591,7 +591,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'Int32EnumPropsNativeComponent'; @@ -622,7 +622,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'IntegerPropNativeComponent'; @@ -655,7 +655,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'RCTInterfaceOnlyComponent'; @@ -696,7 +696,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ImageColorPropNativeComponent'; @@ -741,7 +741,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'NoPropsNoEventsComponent'; @@ -769,7 +769,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'ObjectProps'; @@ -800,7 +800,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'PointPropNativeComponent'; @@ -833,7 +833,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'StringEnumPropsNativeComponent'; @@ -864,7 +864,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'StringPropComponent'; @@ -896,7 +896,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'MultiFile1NativeComponent'; @@ -937,7 +937,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); let nativeComponentName = 'MultiComponent1NativeComponent'; @@ -978,7 +978,7 @@ Map { 'use strict'; -const NativeComponentRegistry = require('NativeComponentRegistry'); +const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); const {UIManager} = require(\\"react-native\\") let nativeComponentName = 'NativeComponentName';