react-navigation/react-navigation · error
createStandardNavigationFactories only works with standard n
Error message
createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type "${type}".` : 'unknown type.'} What it means
createStandardNavigationFactories accepts a navigator object created by createNavigatorFactory-style APIs and requires it to be a 'standard' navigator (not a legacy/grouped type). If the passed navigator's type field isn't the string 'standard', it throws, reporting either the actual type string or 'unknown type' when type isn't a string.
Source
Thrown at packages/native/src/createStandardNavigationFactories.tsx:82
>(
navigator: ReturnType<
typeof createStandardNavigator<
TypeBag['ScreenOptions'],
StandardEventMap<TypeBag['EventMap']>,
NavigatorProps & MapperProps
>
>,
router: RouterFactory<
StandardNavigationTypeBagFor<TypeBag, ParamListBase>['State'],
NavigationAction,
TypeBag['RouterOptions']
>,
mapper?: (props: StandardNavigationMapperProps<TypeBag>) => MapperProps
) {
const { type, version, NavigatorContent } = navigator;
if (type !== 'standard') {
throw new Error(
`createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type "${type}".` : 'unknown type.'}`
);
}
if (version !== 1) {
throw new Error(
`createStandardNavigationFactories only works with version 1 of standard navigator objects, but got version ${version}.`
);
}
type StandardArgs = StandardNavigationArgs<
TypeBag['ScreenOptions'],
StandardEventMap<TypeBag['EventMap']>
>;
function StandardNavigationNavigator(props: any) {
const builder = useNavigationBuilder<
TypeBag['State'],View on GitHub (pinned to ab1319d6bb)
Solutions
- Pass the navigator object created with the standard createNavigatorFactory API (type === 'standard').
- Check the navigator's type field (typeof type === 'string' shows the actual type) and use the correct factory for it.
- Align all @react-navigation/* package versions so the navigator object shape matches.
Example fix
// before const factories = createStandardNavigationFactories(LegacyNavigator); // after const factories = createStandardNavigationFactories(createNavigatorFactory(StackNavigator));
Defensive patterns
Strategy: type-guard
Validate before calling
if (navigator?.type !== 'standard') throw new Error('Expected a standard navigator object before calling createStandardNavigationFactories'); Type guard
function isStandardNavigator(n: any): n is { type: 'standard'; version: number; NavigatorContent: React.ComponentType<any> } { return n != null && n.type === 'standard'; } Try / catch
try { return createStandardNavigationFactories(navigator); } catch (e) { if (String(e.message).includes('only works with standard navigator')) { console.error('Wrong navigator object passed:', navigator); return null; } throw e; } Prevention
- Only pass results of the current createNavigatorFactory API into this helper.
- Check navigator.type in dev before wiring factories.
- Keep all @react-navigation packages on matching versions.
When it happens
Trigger: Calling createStandardNavigationFactories with a navigator object whose type !== 'standard' — e.g. a legacy navigator, a bare component, or undefined/null instead of a navigator object.
Common situations: Mixing navigator factory outputs from incompatible @react-navigation versions; passing a Navigator component instead of the wrapper object; autocompleting into the wrong export.
Related errors
- The 'tabBarIcon' function must return an icon object (got ${
- Couldn't find a navigation object for '${routeName}' because
- Cannot call setOptions outside a screen
- createStandardNavigationFactories only works with version 1
- Couldn't find values for tab animation. Are you inside a scr
AI-assisted analysis of react-navigation/react-navigation@ab1319d6bb (2026-08-31).
Data as JSON: /api/errors/5742b86f1117fd74.
Report an issue: GitHub.