From e859ab660ec58321e7e7d26a73d84b9c01bd764b Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 22 May 2026 14:00:02 -0700 Subject: [PATCH 1/2] Remove unreferenced ViewNativeComponentType (#56943) Summary: Discovered while I try to understand the best shape for ref types. We have no other 1P component usage pattern for `React.ElementRef`, except for two now-removed fbsource instances, replaced with `React.ElementRef`. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D106093290 --- .../Libraries/Components/View/ViewNativeComponent.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/react-native/Libraries/Components/View/ViewNativeComponent.js b/packages/react-native/Libraries/Components/View/ViewNativeComponent.js index 600eee6fedb7..2a28cd4bd992 100644 --- a/packages/react-native/Libraries/Components/View/ViewNativeComponent.js +++ b/packages/react-native/Libraries/Components/View/ViewNativeComponent.js @@ -42,5 +42,3 @@ export const Commands: NativeCommands = codegenNativeCommands({ // Additional note: Our long term plan is to reduce the overhead of the // and wrappers so that we no longer have any reason to export these APIs. export default ViewNativeComponent; - -export type ViewNativeComponentType = HostComponent; From 60fe049a2104288951951a5a4ba27e27fcf1d162 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Fri, 22 May 2026 14:00:02 -0700 Subject: [PATCH 2/2] Replace use of private HostInstance types in Fantom tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: #### Motivation - This aligns with how all `xplat/js` callers need to access this type via the public Flow API. This leaves `HostInstance` (exported at root) as the remaining exception to the rule — and remains an open design problem I'm looking to address in T270727973 (via RN WG consultation). Differential Revision: D106128324 --- .../TextInput/__tests__/TextInput-itest.js | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js b/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js index fc3984b6281c..7a9e2a47bc3c 100644 --- a/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js +++ b/packages/react-native/Libraries/Components/TextInput/__tests__/TextInput-itest.js @@ -10,8 +10,6 @@ import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; -import type {TextInputInstance} from '../TextInput.flow'; - import * as Fantom from '@react-native/fantom'; import nullthrows from 'nullthrows'; import * as React from 'react'; @@ -45,7 +43,7 @@ describe('', () => { describe('onChange', () => { it('is called when the change native event is dispatched', () => { const root = Fantom.createRoot(); - const nodeRef = createRef(); + const nodeRef = createRef>(); const onChange = jest.fn(); Fantom.runTask(() => { @@ -76,7 +74,7 @@ describe('', () => { describe('onChangeText', () => { it('is called when the change native event is dispatched', () => { const root = Fantom.createRoot(); - const nodeRef = createRef(); + const nodeRef = createRef>(); const onChangeText = jest.fn(); Fantom.runTask(() => { @@ -100,7 +98,7 @@ describe('', () => { describe('onFocus', () => { it('is called when the focus native event is dispatched', () => { const root = Fantom.createRoot(); - const nodeRef = createRef(); + const nodeRef = createRef>(); let focusEvent = jest.fn(); @@ -126,7 +124,7 @@ describe('', () => { describe('onBlur', () => { it('is called when the blur native event is dispatched', () => { const root = Fantom.createRoot(); - const nodeRef = createRef(); + const nodeRef = createRef>(); let blurEvent = jest.fn(); @@ -284,7 +282,7 @@ describe('', () => { describe('ref', () => { it('is an element node', () => { - const ref = createRef(); + const ref = createRef>(); const root = Fantom.createRoot(); @@ -296,7 +294,7 @@ describe('', () => { }); it('provides additional methods: clear, isFocused, getNativeRef, setSelection', () => { - const ref = createRef(); + const ref = createRef>(); const root = Fantom.createRoot(); @@ -313,7 +311,7 @@ describe('', () => { describe('focus()', () => { it('dispatches the focus command', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -411,8 +409,8 @@ describe('', () => { it('unfocuses any previously focused TextInput when a new one is focused', () => { const root = Fantom.createRoot(); - const ref1 = createRef(); - const ref2 = createRef(); + const ref1 = createRef>(); + const ref2 = createRef>(); Fantom.runTask(() => { root.render( @@ -450,7 +448,7 @@ describe('', () => { describe('blur()', () => { it('does NOT dispatch any commands if the input is NOT focused', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -469,7 +467,7 @@ describe('', () => { it('does dispatches the blur command if the input is focused', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -496,7 +494,7 @@ describe('', () => { describe('clear()', () => { it('dispatches the clear command', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render( @@ -521,7 +519,7 @@ describe('', () => { describe('isFocused()', () => { it('returns true if the input is focused', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -546,7 +544,7 @@ describe('', () => { it('returns false if the input is unmounted', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -582,7 +580,7 @@ describe('', () => { expect(TextInput.State.currentlyFocusedInput()).toBe(null); const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(); @@ -606,7 +604,7 @@ describe('', () => { describe('setSelection', () => { it('dispatches the setTextAndSelection command', () => { const root = Fantom.createRoot(); - const ref = createRef(); + const ref = createRef>(); Fantom.runTask(() => { root.render(