react-stack-navigator
Version:
A native-like stack navigator for React DOM, inspired by Flutter's Navigator v1
31 lines (30 loc) • 770 B
TypeScript
import React, { ReactChild } from 'react';
import '../src/styles.css';
interface StackEntry {
child: ReactChild;
resolve: (result: any) => void;
isModal: boolean;
}
export interface StackNavigatorProps {
/**
* The route at the bottom of the stack
*/
root: ReactChild;
}
interface StackNavigatorState {
stack: StackEntry[];
}
export declare class StackNavigator extends React.Component<StackNavigatorProps, StackNavigatorState> {
state: StackNavigatorState;
private lastHistoryIndex;
private lastPopWasProgrammatic;
componentDidMount(): void;
componentWillUnmount(): void;
private onPopState;
private pushRoute;
private popRoute;
private push;
private pop;
render(): JSX.Element;
}
export {};