react-native-screens
Version:
Native navigation primitives for your React Native app.
25 lines (17 loc) • 647 B
text/typescript
import { NativeSyntheticEvent, ViewProps } from 'react-native';
export type GenericEmptyEvent = Record<string, never>;
export type StackScreenEventHandler = (
event: NativeSyntheticEvent<GenericEmptyEvent>,
) => void;
export type StackScreenProps = {
children?: ViewProps['children'];
maxLifecycleState: 0 | 1 | 2; // TODO: Figure out to type this w/o circular import
screenKey: string;
// Events
onWillAppear?: StackScreenEventHandler;
onDidAppear?: StackScreenEventHandler;
onWillDisappear?: StackScreenEventHandler;
onDidDisappear?: StackScreenEventHandler;
// Custom events
onPop?: (screenKey: string) => void;
};