From eb39e6abde0e695a1838002b5d89e704a91139d6 Mon Sep 17 00:00:00 2001 From: threadhoard-vps Date: Tue, 19 May 2026 12:18:44 +0000 Subject: [PATCH] fix(types): expose Modal native ref prop --- packages/react-native/Libraries/Modal/Modal.d.ts | 5 +++++ packages/react-native/types/__typetests__/index.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/react-native/Libraries/Modal/Modal.d.ts b/packages/react-native/Libraries/Modal/Modal.d.ts index 9c9e1ea57228..88af235fe13b 100644 --- a/packages/react-native/Libraries/Modal/Modal.d.ts +++ b/packages/react-native/Libraries/Modal/Modal.d.ts @@ -50,6 +50,11 @@ export interface ModalBaseProps { * Defaults to `white` if not provided and transparent is `false`. Ignored if `transparent` is `true`. */ backdropColor?: ColorValue | undefined; + + /** + * A ref to the native Modal component. + */ + modalRef?: React.RefObject | undefined; } export interface ModalPropsIOS { diff --git a/packages/react-native/types/__typetests__/index.tsx b/packages/react-native/types/__typetests__/index.tsx index e3c90772a81c..a3bfdb5286bb 100644 --- a/packages/react-native/types/__typetests__/index.tsx +++ b/packages/react-native/types/__typetests__/index.tsx @@ -46,6 +46,7 @@ import { FocusEvent, GestureResponderEvent, HostComponent, + HostInstance, I18nManager, Image, ImageBackground, @@ -1540,6 +1541,10 @@ const KeyboardAvoidingViewTest = () => ; const ModalTest = () => ; const ModalTest2 = () => ; +const ModalRefTest = () => { + const modalRef = React.useRef(null); + return ; +}; // $ExpectType HostComponent<{ nativeProp: string; }> const NativeBridgedComponent = requireNativeComponent<{nativeProp: string}>(