react-native-screens
Version:
Native navigation primitives for your React Native app.
33 lines (23 loc) • 858 B
text/typescript
import { NativeSyntheticEvent, ViewProps } from 'react-native';
export type OnDismissEventPayload = {
isNativeDismiss: boolean;
};
export type EmptyEventPayload = Record<string, never>;
export type OnDismissEvent = NativeSyntheticEvent<OnDismissEventPayload>;
export type StackScreenActivityMode = 'detached' | 'attached';
export type StackScreenEventHandler = (
event: NativeSyntheticEvent<EmptyEventPayload>,
) => void;
export type StackScreenProps = {
children?: ViewProps['children'];
// Control
activityMode: StackScreenActivityMode;
screenKey: string;
// Events
onWillAppear?: StackScreenEventHandler;
onDidAppear?: StackScreenEventHandler;
onWillDisappear?: StackScreenEventHandler;
onDidDisappear?: StackScreenEventHandler;
onDismiss?: (screenKey: string) => void;
onNativeDismiss?: (screenKey: string) => void;
};