This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Expo Router
A file-based routing library for React Native and web applications.
expo-router is a routing library for React Native and web apps. It enables navigation management using a file-based routing system and provides native navigation components.
Learn about Expo Router basics, navigation patterns, core concepts, and more.
In SDK 56 and later, Expo Router no longer supports importing from external
@react-navigation/*packages in application code. Repoint those imports to the matchingexpo-routerentry points. Run the codemod or follow the SDK 55 to 56 migration guide to update your project.
Installation
To use Expo Router in your project, you need to install. Follow the instructions from the Expo Router's installation guide:
Learn how to install Expo Router in your project.
Configuration in app config
If you are using the default template to create a new project, expo-router's config plugin is already configured in your app config.
Example app.json with config plugin
Configurable properties
Usage
For information core concepts, notation patterns, navigation layouts, and common navigation patterns, start with Router 101 section:
APIs
API
import { useRouter, Tabs, Navigator, Slot } from 'expo-router';
Components
Type: React.Element<BadgeProps>
Type: React.Element<ErrorBoundaryProps>
Type: React.Element<Omit<Omit<StandardUseNavigationBuilderOptions<StackNavigationState<ParamListBase>, ExperimentalStackNavigationOptions, StandardExperimentalStackNavigationEventMap>, 'initialRouteName'> & Omit<object, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'> & Partial<Pick<Omit<StandardUseNavigationBuilderOptions<StackNavigationState<ParamListBase>, ExperimentalStackNavigationOptions, StandardExperimentalStackNavigationEventMap>, 'initialRouteName'> & Omit<object, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'>>>
Renders the new react-native-screens/experimental native stack.
Sibling to Stack. Native-only — on web it falls back to the standard Stack.
Opt-in per navigator: replace <Stack /> with <ExperimentalStack /> in the
specific layout you want to migrate.
Type: React.Element<LabelProps>
Type: React.Element<LocaleProviderProps>
LocaleDirectionType: React.Element<Props>
Type: React.Element<React.FC>
Root style-reset for full-screen React Native web apps with a root <ScrollView /> should use the following styles to ensure native parity. See React Native for Web's root element setup.
Type: React.Element<React.FC>
Type: React.Element<Omit<NavigatorProps<any>, 'children' | 'activityEnabled' | 'activityDefaultThreshold'> & {
activityEnabled: boolean
}>
Renders the currently selected content.
There are actually two different implementations of <Slot/>:
- Used inside a
_layoutas theNavigator - Used inside a
Navigatoras the content
Since a custom Navigator will set the NavigatorContext.contextKey to
the current _layout, you can use this to determine if you are inside
a custom navigator or not.
Type: React.Element<SuspenseFallbackProps>
Type: React.Element<Props>
Type: React.Element<VectorIconProps<NameT>>
Helper component for loading vector icons.
Prefer using the md and sf props on Icon rather than using this component directly.
Only use this component when you need to load a specific icon from a vector icon family.
Example
import { Icon, VectorIcon } from 'expo-router'; import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons'; <Icon src={<VectorIcon family={MaterialCommunityIcons} name="home" />} />
{
getImageSource: (name: NameT, size: number, color: ColorValue) => Promise<ImageSourcePropType | null>
}The family of the vector icon.
Example
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
Type: React.Element<StackScreenProps>
Type: React.Element<StackScreenBackButtonProps>
Component to configure the back button.
Can be used inside Stack.Screen in a layout or directly inside a screen component.
Example
import { Stack } from 'expo-router'; export default function Layout() { return ( <Stack> <Stack.Screen name="detail"> <Stack.Screen.BackButton displayMode="minimal">Back</Stack.Screen.BackButton> </Stack.Screen> </Stack> ); }
Example
import { Stack } from 'expo-router'; export default function Page() { return ( <> <Stack.Screen.BackButton hidden /> <ScreenContent /> </> ); }
Note: If multiple instances of this component are rendered for the same screen, the last one rendered in the component tree takes precedence.
Deprecated: Use
Stack.Titleinstead.
Type: React.Element<StackTitleProps>
Constants
Type: Context<boolean>
Indicates that descendants are rendered inside a native navigator.
Native navigator integrations should provide true so incompatible nested navigators can fail
before reaching the native view hierarchy.
Type: ImperativeRouter
Type: Pick<Performance, 'getEntries' | 'getEntriesByName' | 'getEntriesByType' | 'clearMarks'>
Reads the performance marks that Expo Router records during navigation. It has the
mark-related methods of the global
performance object. On web,
it is the global performance object, so getEntries() also returns entries that Expo Router
did not record.
On native, Expo Router keeps the latest 250 marks. It also passes each mark to the global
performance.mark(), so the marks show in the React Native DevTools timeline.
Hooks
Returns route info for a screen it is called from.
UrlObject | undefinedHook to run an effect whenever a route is focused. Similar to
React.useEffect, but the effect re-runs
each time the screen comes into focus, and the optional cleanup function runs when the
screen loses focus — not on unmount. This makes it the right primitive for refetching
data, restarting subscriptions, or resetting transient screen state every time a user
returns to the route.
The passed callback should be wrapped in React.useCallback
to avoid running the effect too often.
voidExample
import { useFocusEffect } from 'expo-router'; import { useCallback } from 'react'; export default function Route() { useFocusEffect( // Callback should be wrapped in `React.useCallback` to avoid running the effect too often. useCallback(() => { // Invoked whenever the route is focused. console.log("Hello, I'm focused!"); // Return function is invoked whenever the route gets out of focus. return () => { console.log('This route is now unfocused.'); }; }, []), ); return </>; }
Returns URL parameters for globally selected route, including dynamic path segments. This function updates even when the route is not focused. Useful for analytics or other background operations that don't draw to the screen.
Route URL example: acme://profile/baconbrix?extra=info.
When querying search params in a stack, opt-towards using
useLocalSearchParams because it will only update when the route is focused.
Note: For usage information, see Local versus global search parameters.
RouteOutputParams<TRoute> & TParamsExample
Hook to get the current focus state of the screen. Returns a true if screen is focused, otherwise false.
This can be used if a component needs to render something based on the focus state.
booleanReturns the result of the loader function for the calling route.
LoaderFunctionResult<T>Example
Returns the URL parameters for the contextually focused route. Useful for stacks where you may push a new screen that changes the query parameters. For dynamic routes, both the route parameters and the search parameters are returned.
Route URL example: acme://profile/baconbrix?extra=info.
To observe updates even when the invoking route is not focused, use useGlobalSearchParams.
Note: For usage information, see Local versus global search parameters.
RouteOutputParams<TRoute> & TParamsExample
Returns the navigation object for the current route. Use it to access
layout-specific functionality, such as navigation.openDrawer() in a
Drawer layout.
TThe navigation object for the current route.
See: Navigating between pages for Router navigation, and Drawer for layout-specific navigation methods.
Example
When using nested layouts, you can access higher-order layouts by passing a secondary argument denoting the layout route.
For example, /menu/_layout.tsx is nested inside /app/orders/, you can use useNavigation('/orders/menu/').
Example
If you attempt to access a layout that doesn't exist, an error such as
Could not find parent navigation with route "/non-existent" is thrown.
NavigationContainerRefWithCurrent<RootParamList>The root <NavigationContainer /> ref for the app. The ref.current may be null
if the <NavigationContainer /> hasn't mounted yet.
Returns the currently selected route location without search parameters. For example, /acme?foo=bar returns /acme.
Segments will be normalized. For example, /[id]?id=normal becomes /normal.
stringExample
Prevents the screen from being removed while preventRemove is true and calls callback
with the blocked navigation action.
To continue the blocked navigation action, set preventRemove to false and call the
callback's repeat function. To navigate somewhere else, set preventRemove to false, call
the returned disablePrevention function, and then navigate.
On web, this hook also prevents the browser from unloading the page while preventRemove is
true.
() => voidExample
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(true); usePreventRemove(hasUnsavedChanges, ({ repeat }) => { Alert.alert('Discard changes?', undefined, [ { text: 'Cancel', style: 'cancel' }, { text: 'Discard', style: 'destructive', onPress: () => { setHasUnsavedChanges(false); repeat(); }, }, ]); });
Deprecated: Use
useNavigationContainerRefinstead, which returns a Reactref.
NavigationContainerRef<ParamListBase> | nullReturns the navigation state of the root navigator — the top-level navigator that
contains the current screen. Its shape follows the NavigationState type of the
installed expo-router version.
NavigationStateThe current NavigationState of the root navigator.
Example
import { useRootNavigationState } from 'expo-router'; export default function Route() { const { routes } = useRootNavigationState(); return <Text>{routes[0].name}</Text>; }
Hook to access the route prop of the parent screen anywhere.
TRoute prop of the parent screen.
Hook to get the path for the current route based on linking options.
stringPath for the current route.
Returns the Router object for imperative navigation.
ImperativeRouterExample
import { useRouter } from 'expo-router'; import { Text } from 'react-native'; export default function Route() { const router = useRouter(); return ( <Text onPress={() => router.push('/home')}>Go Home</Text> ); }
Returns a list of selected file segments for the currently selected route. Segments are not normalized,
so they will be the same as the file path. For example, /[id]?id=normal becomes ["[id]"].
RouteSegments<TSegments>Example
useSegments can be typed using an abstract. Consider the following file structure:
- app - [user] - index.tsx - followers.tsx - settings.tsx
This can be strictly typed using the following abstract with useSegments hook:
const [first, second] = useSegments<['settings'] | ['[user]'] | ['[user]', 'followers']>()
Returns the server document data for server-side rendering, including <html>/<body>
attributes and additional nodes to add to <head>/<body> for metadata and assets.
ServerDocumentDataExample
import { useServerDocumentContext } from 'expo-router/html'; export default function Root({ children }) { const { htmlAttributes, bodyAttributes, headNodes, bodyNodes } = useServerDocumentContext(); return ( <html {...htmlAttributes}> <head>{headNodes}</head> <body {...bodyAttributes}> {children} {bodyNodes} </body> </html> ); }
SitemapType | nullClasses
Type: Class implements PerformanceObserver
Observes the performance marks that Expo Router records during navigation. On web, it is the
global PerformanceObserver.
On native, it implements the same API for mark entries. Unlike the React Native
PerformanceObserver, it keeps the detail of each mark.
Check the name of an entry and cast it to the matching mark type, for example
RouterPageFocusedMark, to read its detail.
Example
unstable_PerformanceObserver Properties
readonly string[]The static supportedEntryTypes read-only property of the PerformanceObserver interface returns an array of the entryType values supported by the user agent.
Methods
Attaches trusted nested state from a navigation action to a route and removes Expo Router's
internal state markers at every nested level. State without the internal
__internal__routerActionState marker is ignored and triggers a warning in development.
TThe original route object when the action has no state, the state lacks the marker, or the state after removing markers is deeply equal to the route's existing state. Otherwise, returns a new route object with the nested state attached, without mutating the original route or action.
Example
// Inside a custom router's action handler, preserve nested state from the incoming action. const route = attachRouteState( { key: nextKey(action.payload.name), name: action.payload.name, params: action.payload.params, }, action );
Creates the shared props for integrating a stack navigator with Expo Router.
{
isPreloaded: (key: string) => boolean,
isRemovalPrevented: (key: string) => boolean,
pop: (count: number, sourceRouteKey: string) => void,
subscribePopToTopOnParentTabPress: () => any
}The shared stack navigator props.
Example
import { createBaseStackProps, StackRouter, integrateWithRouter } from 'expo-router'; import { navigator } from './navigator'; export const Stack = integrateWithRouter(navigator, StackRouter, { createProps: createBaseStackProps, });
Creates the shared props for integrating a tab navigator with Expo Router.
{
isPreloaded: (key: string) => boolean,
isRemovalPrevented: (key: string) => boolean,
preload: (name: string) => void,
routeNames: string[]
}The shared tab navigator props.
Example
import { createBaseTabProps, TabRouter, integrateWithRouter } from 'expo-router'; import { navigator } from './navigator'; export const Tabs = integrateWithRouter(navigator, TabRouter, { createProps: createBaseTabProps, });
Creates the props required to integrate Expo Router's native stack navigator.
NativeStackNavigatorCreatePropsThe native stack navigator props.
Example
import { createNativeStackProps, StackRouter, integrateWithRouter, } from 'expo-router'; import { navigator } from './navigator'; export const Stack = integrateWithRouter(navigator, StackRouter, { createProps: createNativeStackProps, });
Creates a standard-navigation navigator and
wires it into Expo Router in one step. Use integrateWithRouter instead if you already
have a navigator from createStandardNavigator.
Props declared in both NavigatorProps and CreateProps are intersected, so incompatible types
produce never rather than a type error at this call.
Component<PropsWithoutRef<PickPartial<Omit<StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap>, 'initialRouteName'> & Omit<NavigatorProps, 'initialRouteName'> & Omit<RouterOptions, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'>>> & {
Protected: FunctionComponent<ProtectedProps>,
Screen: (props: ScreenProps<NavigatorOptions, State, EventMap>) => null
}Example
import { createStandardRouterNavigator, TabRouter } from 'expo-router'; export const Tabs = createStandardRouterNavigator(MyTabsContent, TabRouter);
Deprecated: In a future release, the native iOS header appearance becomes the only behavior and this function will be removed.
Restores the previous header appearance on iOS 26+ for all native stack screens: an opaque
header that uses the theme fonts, with content below the header. Earlier iOS versions already
keep this appearance. Call it before the root layout renders, for example at the top level of
the root _layout file.
Note: Apple's Human Interface Guidelines recommend that apps reduce custom navigation bar backgrounds, because they can interfere with the background effects that the system provides.
voidExample
Creates a router factory that merges the members returned by extension over the router
created by base.
Annotate the extension's context or return type to change the state, action, or options types.
(options: Options) => ExtendedRouter<State, Action>Example
const Router = extendRouter(StackRouter, ({ baseRouter }) => ({ getStateForRouteFocus: (state, key) => { ... }, }));
Creates a router factory whose getStateForAction runs reducer before the base router.
Every other router member, including shouldActionChangeFocus, is inherited; use
extendRouter to change those.
Annotate the reducer's action or context parameter to add action types or widen the
router options.
(options: Options) => ExtendedRouter<State, Action>Example
const Router = extendRouterActions(StackRouter, (state, action: StackAction | ClearAction, { nextKey }) => { if (action.type !== 'CLEAR') { return RouterActionHandling.Delegate; } const route = { key: nextKey('index'), name: 'index' }; return { state: { ...state, index: 0, routes: [route] }, affectedRouteKey: route.key }; });
Wires an existing standard-navigation
navigator into Expo Router, returning a navigator component (with a .Screen child) usable as a
layout. Use createStandardRouterNavigator to create and integrate in one step.
Component<PropsWithoutRef<PickPartial<Omit<StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap>, 'initialRouteName'> & Omit<NavigatorProps, 'initialRouteName'> & Omit<RouterOptions, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'>>> & {
Protected: FunctionComponent<ProtectedProps>,
Screen: (props: ScreenProps<NavigatorOptions, State, EventMap>) => null
}Example
import { createStandardNavigator } from 'standard-navigation'; import { integrateWithRouter, TabRouter } from 'expo-router'; const navigator = createStandardNavigator(MyTabsContent); export const Tabs = integrateWithRouter(navigator, TabRouter);
Checks whether a router's getStateForAction handled the action. Use it instead of comparing
the result with null, because a router can leave an action unhandled with
RouterActionHandling.Unhandled or the deprecated null.
resultExample
const result = baseRouter.getStateForAction(state, action); if (!isActionHandled(result)) { return result; }
Wraps the screen contents in a React Activity that hides once the screen is buried deep enough
in the stack. Hiding runs effect cleanups and releases resources, but keeps React state, so the
screen looks unchanged when the user navigates back to it.
Must be rendered inside a screen component.
ElementStackRouter is considered an internal implementation and its behavior may change without a notice between expo-router's version
ExtendedRouter<StackNavigationState<ParamListBase>, CommonNavigationAction | StackActionType>TabRouter is considered an internal implementation and its behavior may change without a notice between expo-router's version
ExtendedRouter<TabNavigationState<ParamListBase>, CommonNavigationAction | TabActionType>Deprecated: Use
createStandardRouterNavigatorinstead.
Component<PropsWithoutRef<PickPartial<Omit<StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap>, 'initialRouteName'> & Omit<NavigatorProps, 'initialRouteName'> & Omit<RouterOptions, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'>>> & {
Protected: FunctionComponent<ProtectedProps>,
Screen: (props: ScreenProps<NavigatorOptions, State, EventMap>) => null
}Starts recording the performance marks of Expo Router navigation. Call it before the root
layout mounts, for example at the top level of the root _layout file.
voidDeprecated: Use
integrateWithRouterinstead.
Component<PropsWithoutRef<PickPartial<Omit<StandardUseNavigationBuilderOptions<State, NavigatorOptions, EventMap>, 'initialRouteName'> & Omit<NavigatorProps, 'initialRouteName'> & Omit<RouterOptions, 'initialRouteName'> & {
unstable_screenErrorBoundary: ComponentType<ErrorBoundaryProps>
}, 'children'>>> & {
Protected: FunctionComponent<ProtectedProps>,
Screen: (props: ScreenProps<NavigatorOptions, State, EventMap>) => null
}Returns whether a navigation is queued or its state update is pending.
The current screen can remain visible while this returns true if the destination suspends.
navigation.dispatchSync bypasses the queue, and native back gestures never enter it, so this
hook does not report navigation triggered by either one.
Returns false when called outside an Expo Router root.
booleanDeprecated: Use
integrateWithRouterinstead.
Returns a navigator that automatically injects matched routes and renders nothing when there are no children.
Return type with children prop optional.
Enables use of other built-in React Navigation navigators and other navigators built with the React Navigation custom navigator API.
Component<PropsWithoutRef<PickPartial<ComponentProps<T>, 'children'>>> & {
Protected: FunctionComponent<ProtectedProps>,
Screen: (props: ScreenProps<TOptions, TState, TEventMap>) => null
}Example
Interfaces
Extends: PerformanceMark
A performance mark recorded by Expo Router.
To read detail, check its name and cast it to the matching mark type, such as
RouterPageFocusedMark.
The navigation action that an expo-router:action-enqueued or expo-router:action-dispatched mark describes.
Extends: NavigatorDescriptor<NavigatorOptions>
A standard-navigation descriptor extended with Expo Router route information.
Types
Literal type: union
Acceptable values are: CommonActions.Action | CommonActions.InternalRouteNamesChangedAction
Memoized callback containing the effect, should optionally return a cleanup function.
undefined | void | () => void
Navigator-level events emitted by ExperimentalStack. Mirrors the subset of
NativeStackNavigationEventMap that the gamma Stack.Screen lifecycle
callbacks can drive.
Options accepted by ExperimentalStack screens. Mirrors the narrow option
surface of the gamma <Stack.HeaderConfig> component from
react-native-screens/experimental. Anything outside this shape is dropped
with a __DEV__ warning at runtime.
Literal type: union
Acceptable values are: NavigationProp<ParamList, RouteName, NavigatorID, StackNavigationState<ParamList>, ExperimentalStackNavigationOptions, ExperimentalStackNavigationEventMap> | StackActionHelpers<ParamList>
Literal type: union
Acceptable values are: {string}:{string} | //{string}
The main routing type for Expo Router. It includes all available routes with strongly typed parameters. It can either be:
- string: A full path like
/profile/settingsor a relative path like../settings. - object: An object with a
pathnameand optionalparams. Thepathnamecan be a full path like/profile/settingsor a relative path like../settings. The params can be an object of key-value pairs.
An Href can either be a string or an object.
Generic: T
Type: T ? T[href] : string | HrefObject
Returns router object for imperative navigation API.
Example
import { router } from 'expo-router'; import { Text } from 'react-native'; export default function Route() { return ( <Text onPress={() => router.push('/home')}>Go Home</Text> ); }
Deprecated: Use the
I18nManagerAPI fromreact-nativeto read locale direction. Will be removed in a future SDK.
Literal type: string
Acceptable values are: 'ltr' | 'rtl'
Created by using a special file called +native-intent.tsx at the top-level of your
project's app directory. It exports redirectSystemPath or legacy_subscribe functions,
both methods designed to handle URL/path processing.
Useful for re-writing URLs to correctly target a route when unique/referred URLs are incoming from third-party providers or stale URLs from previous versions.
See: For more information on how to use
NativeIntent, see Customizing links.
Literal type: union
An item that can be displayed in the header. It can be a button, a menu, spacing, or a custom element.
On iOS 26, when showing items on the right side of the header,
if the items don't fit the available space, they will be collapsed into a menu automatically.
Items with type: 'custom' will not be included in this automatic collapsing behavior.
Acceptable values are: NativeStackHeaderItemButton | NativeStackHeaderItemMenu | NativeStackHeaderItemSpacing | NativeStackHeaderItemCustom
A button item in the header.
Type: SharedHeaderItem extended by:
A custom item to display any React Element in the header.
An item that shows a menu when pressed.
Type: SharedHeaderItem extended by:
An item to add spacing between other items in the header.
Literal type: union
Acceptable values are: NavigationProp<ParamList, RouteName, NavigatorID, StackNavigationState<ParamList>, NativeStackNavigationOptions, NativeStackNavigationEventMap> | StackActionHelpers<ParamList>
Type: Omit<NativeStackScreenProps<ParamList, RouteName, NavigatorID>, 'route'> extended by:
Type: Pick<StackNavigationState<ParamListBase>, 'index' | 'routes'>
The navigator-level state consumed by NativeStackView.
Routes after index are preloaded and rendered natively-detached.
Type: Readonly<{
payload: object,
source: string,
target: string,
type: string
}>
Type: Readonly<{
history: unknown[],
index: number,
key: string,
routeKeySeq: number,
routeNames: Extract[],
routes: NavigationRoute[],
stale: false,
type: string
}>
Literal type: string
Acceptable values are: 'always' | 'never' | 'preload-only'
Literal type: union
The list of input keys will become optional, everything else will remain the same.
Literal type: union
Acceptable values are: ./{string} | ../{string} | '..'
Type: Exclude<Extract[pathname], RelativePathString | ExternalPathString>
Literal type: union
Acceptable values are: RouterConfigOptions | Pick<RouterExtensionContext<State, Action, Options>, 'baseRouter' | 'options' | 'nextKey'>
Type: BaseRouterPerformanceMark<'expo-router:action-dispatched', RouterActionMarkDetail>
A navigation action changed the navigation state.
Type: BaseRouterPerformanceMark<'expo-router:action-enqueued', Pick<RouterActionMarkDetail, 'actionId'>>
Expo Router received a navigation action, before it reduced it. If the action
changes the navigation state, expo-router:action-dispatched marks with the same actionId
follow.
Reduces one action. Return a result to handle the action, RouterActionHandling.Delegate to
let the base router handle it, or RouterActionHandling.Unhandled to leave it unhandled.
RouterActionResult<State> | RouterActionHandling | null | undefined
A router's instruction for synchronizing an accepted action with browser history.
Type: object shaped as below:
Or object shaped as below:
Or object shaped as below:
Returns the router members to merge over the base router. Members that are left out are
inherited from the base router, including actionCreators: return a merged object to add
action creators instead of replacing them. An inherited normalizeState runs on the extended
state type, so an extension that changes the state type returns its own unless the base's fits.
Partial<RouterExtensionMembers<State, Action>>
Two instantiations with different State types are not assignable to each other, because
Router requires type conditionally on State. Annotate a factory that should accept any
router as a function type instead, as extendRouter does.
Router<State, Action>
Type: BaseRouterPerformanceMark<'expo-router:page-blurred', RouterPageMarkDetail>
A focused screen lost focus.
Type: BaseRouterPerformanceMark<'expo-router:page-focused', RouterPageMarkDetail>
A screen became focused, after its content committed.
Type: BaseRouterPerformanceMark<'expo-router:page-preloaded', RouterPageMarkDetail>
A screen that rendered as part of a preload (for example, router.prefetch()) and is not
focused. If the user later navigates to it, Expo Router records expo-router:page-focused.
Type: BaseRouterPerformanceMark<'expo-router:page-removed', RouterPageMarkDetail>
A screen unmounted, or its route info changed.
Literal type: union
Any performance mark recorded by Expo Router. Check name to narrow the type of detail.
Acceptable values are: RouterPagePreloadedMark | RouterPageFocusedMark | RouterPageBlurredMark | RouterPageRemovedMark | RouterActionEnqueuedMark | RouterActionDispatchedMark
Type: Extract<RouterPerformanceMark, {
name: Name
}>
The performance mark type with the given name, for example
RouterPerformanceMarkByName<'expo-router:page-focused'>.
Literal type: string
Whether a screen was declared in the layout (<Screen>/<NativeTabs.Trigger>)
or inferred from the filesystem.
Acceptable values are: 'layout' | 'filesystem'
Type: boolean or object shaped as below:
(name, params) => string | undefined
string | undefinedType: object shaped as below:
Or object shaped as below:
Or object shaped as below:
Or object shaped as below:
Or object shaped as below:
Or object shaped as below:
Type: Record<string, {
canPreventDefault: boolean,
data: object | undefined
}>
Type: DefaultNavigatorOptions<ParamListBase, string | undefined, State, NavigatorOptions, EventMap, any>
Type: object shaped as below:
Or object shaped as below:
Or object shaped as below:
Config plugin types
Literal type: union
Controls whether async routes are enabled. 'development' and 'production' enable them
for that environment only. Production async routes are web-only.
Acceptable values are: 'development' | 'production' | boolean
Literal type: string
HTTP methods a redirect or rewrite rule can match.
Acceptable values are: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD'
Enums
What a router's getStateForAction returns when it does not produce a result itself.
RouterActionHandling.Delegate = "DELEGATE"Lets the base router handle the action. Only an extendRouter extension or an
extendRouterActions reducer can return it.