expo-router
Version:
Expo Router is a file-based router for React Native and web applications.
26 lines (25 loc) • 1.03 kB
TypeScript
import type { ParamListBase, TabNavigationState } from '../react-navigation/native';
import type { StandardNavigatorCreatePropsFactoryDeps } from '../standard-navigation/types';
/**
* Creates the shared props for integrating a tab navigator with Expo Router.
*
* @param dependencies The navigation state and dispatch function provided to a `createProps`
* factory.
* @returns The shared tab navigator props.
*
* @example
* ```tsx
* import { createBaseTabProps, TabRouter, integrateWithRouter } from 'expo-router';
* import { navigator } from './navigator';
*
* export const Tabs = integrateWithRouter(navigator, TabRouter, {
* createProps: createBaseTabProps,
* });
* ```
*/
export declare function createBaseTabProps({ dispatch, isPreloaded, isRemovalPrevented, state, }: StandardNavigatorCreatePropsFactoryDeps<TabNavigationState<ParamListBase>>): {
isPreloaded: (key: string) => boolean;
isRemovalPrevented: (key: string) => boolean;
routeNames: string[];
preload: (name: string) => void;
};