expo-router
Version:
Expo Router is a file-based router for React Native and web applications.
16 lines (15 loc) • 770 B
TypeScript
import type { NativeStackViewState } from '../../../react-navigation/native-stack';
import type { CompositionRegistry } from './types';
/**
* Merges composition component options into navigation descriptors.
*
* Expects the projected state where preloaded routes are appended after `index`.
*
* For each descriptor:
* 1. If no composition options registered → pass through unchanged
* 2. If route is preloaded (positioned after the focused route) → skip composition (pass through)
* 3. Otherwise → merge descriptor.options with composition options (composition wins)
*/
export declare function mergeOptions<T extends {
options: object;
}>(descriptors: Record<string, T>, registry: CompositionRegistry, state: NativeStackViewState): Record<string, T>;