UNPKG

react-stack-navigator

Version:

A native-like stack navigator for React DOM, inspired by Flutter's Navigator v1

24 lines (23 loc) 759 B
import { ReactChild } from 'react'; export interface StackNavigatorContextData { /** * Push a route to the stack and returns its result (if any) * @param child The route's element */ push(child: ReactChild, isModal?: boolean): Promise<any>; /** * Pop the route at the top of the stack, optionally returning a result * @param result The route's result (if any) */ pop(result?: any): void; /** * Whether the route can reasonably call the `pop` function (i.e., if it's not at the bottom of * the stack) */ canPop: boolean; /** * Whether the route is modal */ isModal: boolean; } export declare const StackNavigatorContext: import("react").Context<StackNavigatorContextData>;