{"record":{"id":"8c2381963e316827","repo":"facebook/react","slug":"render-unsupported-legacy-mode-api","errorCode":null,"errorMessage":"render: Unsupported Legacy Mode API.","messagePattern":"render: Unsupported Legacy Mode API\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-native-renderer/src/ReactFabric.js","lineNumber":116,"sourceCode":"  if (logError === false) {\n    return;\n  }\n\n  defaultOnCaughtError(error, errorInfo);\n}\nfunction nativeOnDefaultTransitionIndicator(): void | (() => void) {\n  // Native doesn't have a default indicator.\n}\n\nfunction render(\n  element: Element<ElementType>,\n  containerTag: number,\n  callback: ?() => void,\n  concurrentRoot: ?boolean,\n  options: ?RenderRootOptions,\n): ?ElementRef<ElementType> {\n  if (disableLegacyMode && !concurrentRoot) {\n    throw new Error('render: Unsupported Legacy Mode API.');\n  }\n\n  let root = roots.get(containerTag);\n\n  if (!root) {\n    // TODO: these defaults are for backwards compatibility.\n    // Once RN implements these options internally,\n    // we can remove the defaults and ReactFiberErrorDialog.\n    let onUncaughtError = nativeOnUncaughtError;\n    let onCaughtError = nativeOnCaughtError;\n    let onRecoverableError = defaultOnRecoverableError;\n\n    if (options && options.onUncaughtError !== undefined) {\n      onUncaughtError = options.onUncaughtError;\n    }\n    if (options && options.onCaughtError !== undefined) {\n      onCaughtError = options.onCaughtError;\n    }","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-native-renderer/src/ReactFabric.js#L98-L134","documentation":"ReactFabric.render throws immediately when the renderer build was compiled with disableLegacyMode (the legacy root mode removed) and render is invoked without concurrentRoot=true. It is a hard guard that prevents the legacy ReactDOM.render-style entry point from silently creating an unsupported legacy root in builds where legacy mode no longer exists.","triggerScenarios":"Calling ReactFabric.render(element, containerTag, callback, concurrentRoot=null/falsy, options) on a renderer built with disableLegacyMode - typically the legacy AppRegistry/RN bridge render path, direct use of the internal render export, or test helpers still on the legacy API.","commonSituations":"Newer react-native-renderer builds where the flag is on; old RN apps or libraries pinned to the legacy render API; test setups that call ReactFabric.render directly with no concurrentRoot argument.","solutions":["Switch to the concurrent API: ReactFabric.createRoot(containerTag, options).render(element), or RN's modern AppRegistry registration so concurrentRoot is true.","Pass concurrentRoot=true at every call site you control.","If legacy mode is genuinely required, run a react-native-renderer build matching your RN version where disableLegacyMode is off."],"exampleFix":"// before\nReactFabric.render(<App />, containerTag, callback, false);\n\n// after\nconst root = ReactFabric.createRoot(containerTag, {\n  onUncaughtError,\n  onCaughtError,\n  onRecoverableError,\n});\nroot.render(<App />);","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  ReactFabric.render(element, containerTag, callback, false);\n} catch (e) {\n  if (/Unsupported Legacy Mode API/.test(e.message)) {\n    ReactFabric.createRoot(containerTag).render(element);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Standardize on createRoot / the modern AppRegistry path; never call legacy render().","Audit libraries and test helpers for direct ReactFabric.render usage.","Match your react-native-renderer build to your RN version so flags line up."],"tags":["react-native","legacy-mode","concurrent-mode","fabric"],"backgroundTag":"legacy-render-api-unsupported","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}