Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react-native/Libraries/Modal/Modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Modal | null> | undefined;
}

export interface ModalPropsIOS {
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native/types/__typetests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
FocusEvent,
GestureResponderEvent,
HostComponent,
HostInstance,
I18nManager,
Image,
ImageBackground,
Expand Down Expand Up @@ -1540,6 +1541,10 @@ const KeyboardAvoidingViewTest = () => <KeyboardAvoidingView enabled />;

const ModalTest = () => <Modal hardwareAccelerated />;
const ModalTest2 = () => <Modal hardwareAccelerated testID="modal-test-2" />;
const ModalRefTest = () => {
const modalRef = React.useRef<Modal & HostInstance>(null);
return <Modal modalRef={modalRef} />;
};

// $ExpectType HostComponent<{ nativeProp: string; }>
const NativeBridgedComponent = requireNativeComponent<{nativeProp: string}>(
Expand Down
Loading