UNPKG

699 BTypeScriptView Raw
1import type { NavigationState, ParamListBase } from '@react-navigation/routers';
2import type { RouteProp } from './types';
3/**
4 * Utilites such as `getFocusedRouteNameFromRoute` need to access state.
5 * So we need a way to suppress the warning for those use cases.
6 * This is fine since they are internal utilities and this is not public API.
7 */
8export declare const CHILD_STATE: unique symbol;
9/**
10 * Hook to cache route props for each screen in the navigator.
11 * This lets add warnings and modifications to the route object but keep references between renders.
12 */
13export default function useRouteCache<State extends NavigationState>(routes: State['routes']): RouteProp<ParamListBase, string>[];