expo-router
Version:
Expo Router is a file-based router for React Native and web applications.
16 lines (15 loc) • 679 B
TypeScript
import { type NavigationState, RouterActionHandling, type RouterActionResult } from './types';
/**
* 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`.
*
* @example
* ```ts
* const result = baseRouter.getStateForAction(state, action);
* if (!isActionHandled(result)) {
* return result;
* }
* ```
*/
export declare function isActionHandled<State extends NavigationState>(result: RouterActionResult<State> | RouterActionHandling.Unhandled | null): result is RouterActionResult<State>;