{"record":{"id":"5742b86f1117fd74","repo":"react-navigation/react-navigation","slug":"createstandardnavigationfactories-only-works-with","errorCode":null,"errorMessage":"createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type \"${type}\".` : 'unknown type.'}","messagePattern":"createStandardNavigationFactories only works with standard navigator objects, but got navigator of (.+?)\"\\.` : 'unknown type\\.'\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/native/src/createStandardNavigationFactories.tsx","lineNumber":82,"sourceCode":">(\n  navigator: ReturnType<\n    typeof createStandardNavigator<\n      TypeBag['ScreenOptions'],\n      StandardEventMap<TypeBag['EventMap']>,\n      NavigatorProps & MapperProps\n    >\n  >,\n  router: RouterFactory<\n    StandardNavigationTypeBagFor<TypeBag, ParamListBase>['State'],\n    NavigationAction,\n    TypeBag['RouterOptions']\n  >,\n  mapper?: (props: StandardNavigationMapperProps<TypeBag>) => MapperProps\n) {\n  const { type, version, NavigatorContent } = navigator;\n\n  if (type !== 'standard') {\n    throw new Error(\n      `createStandardNavigationFactories only works with standard navigator objects, but got navigator of ${typeof type === 'string' ? `type \"${type}\".` : 'unknown type.'}`\n    );\n  }\n\n  if (version !== 1) {\n    throw new Error(\n      `createStandardNavigationFactories only works with version 1 of standard navigator objects, but got version ${version}.`\n    );\n  }\n\n  type StandardArgs = StandardNavigationArgs<\n    TypeBag['ScreenOptions'],\n    StandardEventMap<TypeBag['EventMap']>\n  >;\n\n  function StandardNavigationNavigator(props: any) {\n    const builder = useNavigationBuilder<\n      TypeBag['State'],","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/react-navigation/react-navigation/blob/ab1319d6bbf05eae8dc25e33cbf4dc56494e0f0c/packages/native/src/createStandardNavigationFactories.tsx#L64-L100","documentation":"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.","triggerScenarios":"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.","commonSituations":"Mixing navigator factory outputs from incompatible @react-navigation versions; passing a Navigator component instead of the wrapper object; autocompleting into the wrong export.","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."],"exampleFix":"// before\nconst factories = createStandardNavigationFactories(LegacyNavigator);\n// after\nconst factories = createStandardNavigationFactories(createNavigatorFactory(StackNavigator));","handlingStrategy":"type-guard","validationCode":"if (navigator?.type !== 'standard') throw new Error('Expected a standard navigator object before calling createStandardNavigationFactories');","typeGuard":"function isStandardNavigator(n: any): n is { type: 'standard'; version: number; NavigatorContent: React.ComponentType<any> } { return n != null && n.type === 'standard'; }","tryCatchPattern":"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; }","preventionTips":["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."],"tags":["react-navigation","api-misuse","type-mismatch"],"backgroundTag":"incompatible-navigator-type","analyzedSha":"ab1319d6bbf05eae8dc25e33cbf4dc56494e0f0c","analyzedAt":"2026-08-31T14:46:19.520Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}