Use deep require instead of Haste for NativeComponentRegistry

Summary:
Changelog: [Internal]

Some environments that use codegen don't have Haste enabled, breaking the `require('NativeComponentRegistry')` call in generated view configs. Here we change it to reference an explicit path relative to `react-native`.

Reviewed By: JoshuaGross

Differential Revision: D31166063

fbshipit-source-id: cebc23d0d95b5cde76d0f8473eabc03ca82a862e
This commit is contained in:
Moti Zilberman
2021-09-27 13:47:28 -07:00
committed by Facebook GitHub Bot
parent 6ea3df0507
commit 268efb1022
3 changed files with 30 additions and 30 deletions
@@ -22,7 +22,7 @@ interface NativeCommands {
+scrollTo: (viewRef: React.ElementRef<NativeType>, 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<NativeType>, y: Int32, animated: boolean) => void,
}
const NativeComponentRegistry = require('NativeComponentRegistry');
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
const {
dispatchCommand