From dad2849c93238348d49bc258862f7fb0ff83ed3a Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Wed, 17 Jun 2026 15:36:01 +0300 Subject: [PATCH] Add `selection` to `TextInputChangeEventData` in TypeScript types The native onChange event was updated to emit selection data (162627a) and the JS companion (c1f5445) added the corresponding types to the Flow source (TextInput.flow.js) and the generated ReactNativeApi.d.ts, but it missed the legacy hand-written TextInput.d.ts. This adds the optional selection field there so all three type sources agree. --- .../Libraries/Components/TextInput/TextInput.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts index 97535f6cf825..e682fafda227 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.d.ts @@ -515,6 +515,10 @@ export type TextInputKeyPressEvent = export interface TextInputChangeEventData extends TargetedEvent { eventCount: number; text: string; + selection?: { + start: number; + end: number; + }; } /**