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
8 changes: 8 additions & 0 deletions packages/react-native/Libraries/Modal/Modal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
*/

import type * as React from 'react';
import {HostInstance} from '../../types/public/ReactNativeTypes';
import {ViewProps} from '../Components/View/ViewPropTypes';
import {NativeSyntheticEvent} from '../Types/CoreEventTypes';
import {ColorValue} from '../StyleSheet/StyleSheet';

export type PublicModalInstance = HostInstance;

export interface ModalBaseProps {
/**
* @deprecated Use animationType instead
Expand Down Expand Up @@ -50,6 +53,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.Ref<PublicModalInstance> | 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<HostInstance>(null);
return <Modal modalRef={modalRef} />;
};

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