diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js index 556db6835801d5..be45c92c6f4172 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js @@ -9,7 +9,7 @@ */ import RCTDeviceEventEmitter from '../../EventEmitter/RCTDeviceEventEmitter'; -import {sendAccessibilityEvent} from '../../Renderer/shims/ReactNative'; +import {sendAccessibilityEvent} from '../../ReactNative/RendererProxy'; import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes'; import Platform from '../../Utilities/Platform'; import type {EventSubscription} from '../../vendor/emitter/EventEmitter'; diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 38c27d6362cd10..2446276a42dfbf 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -50,8 +50,6 @@ import AndroidHorizontalScrollViewNativeComponent from './AndroidHorizontalScrol import ScrollContentViewNativeComponent from './ScrollContentViewNativeComponent'; import ScrollViewNativeComponent from './ScrollViewNativeComponent'; -require('../../Renderer/shims/ReactNative'); // Force side effects to prevent T55744311 - const {NativeHorizontalScrollViewTuple, NativeVerticalScrollViewTuple} = Platform.OS === 'android' ? { diff --git a/Libraries/Components/Touchable/TouchableNativeFeedback.js b/Libraries/Components/Touchable/TouchableNativeFeedback.js index 265c8489041cf0..21a4061e13ede2 100644 --- a/Libraries/Components/Touchable/TouchableNativeFeedback.js +++ b/Libraries/Components/Touchable/TouchableNativeFeedback.js @@ -14,7 +14,7 @@ import Pressability, { import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import typeof TouchableWithoutFeedback from './TouchableWithoutFeedback'; import {Commands} from 'react-native/Libraries/Components/View/ViewNativeComponent'; -import ReactNative from 'react-native/Libraries/Renderer/shims/ReactNative'; +import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy'; import type {PressEvent} from 'react-native/Libraries/Types/CoreEventTypes'; import Platform from '../../Utilities/Platform'; import View from '../../Components/View/View'; @@ -206,7 +206,7 @@ class TouchableNativeFeedback extends React.Component { _dispatchPressedStateChange(pressed: boolean): void { if (Platform.OS === 'android') { - const hostComponentRef = ReactNative.findHostInstance_DEPRECATED(this); + const hostComponentRef = findHostInstance_DEPRECATED(this); if (hostComponentRef == null) { console.warn( 'Touchable: Unable to find HostComponent instance. ' + @@ -221,7 +221,7 @@ class TouchableNativeFeedback extends React.Component { _dispatchHotspotUpdate(event: PressEvent): void { if (Platform.OS === 'android') { const {locationX, locationY} = event.nativeEvent; - const hostComponentRef = ReactNative.findHostInstance_DEPRECATED(this); + const hostComponentRef = findHostInstance_DEPRECATED(this); if (hostComponentRef == null) { console.warn( 'Touchable: Unable to find HostComponent instance. ' + diff --git a/Libraries/Utilities/codegenNativeCommands.js b/Libraries/Utilities/codegenNativeCommands.js index fe8e23944b7bfc..05e29cd5e6a99c 100644 --- a/Libraries/Utilities/codegenNativeCommands.js +++ b/Libraries/Utilities/codegenNativeCommands.js @@ -8,16 +8,7 @@ * @flow */ -let dispatchCommand; -if (global.RN$Bridgeless) { - // Note: this function has the same implementation in the legacy and new renderer. - // However, evaluating the old renderer comes with some side effects. - dispatchCommand = - require('../../Libraries/Renderer/shims/ReactFabric').dispatchCommand; -} else { - dispatchCommand = - require('../../Libraries/Renderer/shims/ReactNative').dispatchCommand; -} +const {dispatchCommand} = require('../ReactNative/RendererProxy'); type Options = $ReadOnly<{| supportedCommands: $ReadOnlyArray, 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 474b3878339318..93cdd3389e1a4d 100644 --- a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap +++ b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap @@ -30,7 +30,7 @@ const { const { dispatchCommand -} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); +} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); let nativeComponentName = 'RCTModule'; export const __INTERNAL_VIEW_CONFIG = { @@ -99,7 +99,7 @@ const { const { dispatchCommand -} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); +} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); let nativeComponentName = 'RCTModule'; export const __INTERNAL_VIEW_CONFIG = { diff --git a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js index 49e1a9208d74e5..d81748a7de6771 100644 --- a/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js +++ b/packages/react-native-codegen/src/generators/components/GenerateViewConfigJs.js @@ -350,7 +350,7 @@ function buildCommands( } imports.add( - 'const {dispatchCommand} = require("react-native/Libraries/Renderer/shims/ReactNative");', + 'const {dispatchCommand} = require("react-native/Libraries/ReactNative/RendererProxy");', ); const properties = commands.map(command => { 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 f4c068dcb2802e..aeffa286b993d0 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 @@ -169,7 +169,7 @@ Map { 'use strict'; const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); -const {dispatchCommand} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); +const {dispatchCommand} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); let nativeComponentName = 'CommandNativeComponent'; @@ -211,7 +211,7 @@ Map { 'use strict'; const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); -const {dispatchCommand} = require(\\"react-native/Libraries/Renderer/shims/ReactNative\\"); +const {dispatchCommand} = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); let nativeComponentName = 'CommandNativeComponent';