{"record":{"id":"e71f0075e1ea0d0d","repo":"facebook/react","slug":"467","errorCode":"467","errorMessage":"Update hook called on initial render. This is likely a bug in React. Please file an issue.","messagePattern":"Update hook called on initial render\\. This is likely a bug in React\\. Please file an issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberHooks.js","lineNumber":1043,"sourceCode":"    nextWorkInProgressHook = workInProgressHook.next;\n  }\n\n  if (nextWorkInProgressHook !== null) {\n    // There's already a work-in-progress. Reuse it.\n    workInProgressHook = nextWorkInProgressHook;\n    nextWorkInProgressHook = workInProgressHook.next;\n\n    currentHook = nextCurrentHook;\n  } else {\n    // Clone from the current hook.\n\n    if (nextCurrentHook === null) {\n      const currentFiber = currentlyRenderingFiber.alternate;\n      if (currentFiber === null) {\n        // This is the initial render. This branch is reached when the component\n        // suspends, resumes, then renders an additional hook.\n        // Should never be reached because we should switch to the mount dispatcher first.\n        throw new Error(\n          'Update hook called on initial render. This is likely a bug in React. Please file an issue.',\n        );\n      } else {\n        // This is an update. We should always have a current hook.\n        throw new Error('Rendered more hooks than during the previous render.');\n      }\n    }\n\n    currentHook = nextCurrentHook;\n\n    const newHook: Hook = {\n      memoizedState: currentHook.memoizedState,\n\n      baseState: currentHook.baseState,\n      baseQueue: currentHook.baseQueue,\n      queue: currentHook.queue,\n\n      next: null,","sourceCodeStart":1025,"sourceCodeEnd":1061,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberHooks.js#L1025-L1061","documentation":"Internal invariant in updateWorkInProgressHook: the update-path dispatcher ran while `currentlyRenderingFiber.alternate === null` (no committed previous render). Per the adjacent comment, this can be reached when a component suspends, resumes, and then renders an additional hook — React should have switched to the mount dispatcher first, so hitting this throw is a React bug.","triggerScenarios":"The update dispatcher consumes a hook on a fiber with no alternate — a suspend/resume sequence that failed to switch dispatchers back to the mount path, or dispatcher state corrupted by mismatched React copies.","commonSituations":"Rare; reported with use()/suspense resume flows on canary builds, or bundles mixing react-reconciler versions. Not something application code can reach by normal misuse.","solutions":["Upgrade React to the latest stable/canary — dispatcher-switch bugs around suspense resume get fixed over time.","Verify only one copy of react/react-reconciler is loaded (npm ls react; bundler aliases).","Reproduce minimally and file an issue at https://github.com/facebook/react/issues."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Rule out the environment cause up front\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nif (React.version !== ReactDOM.version) throw new Error('mismatch');","typeGuard":null,"tryCatchPattern":"// Report-only containment; the fix is upstream\nclass InvariantBoundary extends React.Component {\n  componentDidCatch(err) {\n    if (err.message.includes('Update hook called on initial render')) {\n      reportReactIssue({err, version: React.version});\n    }\n    throw err;\n  }\n  render() { return this.props.children; }\n}","preventionTips":["Upgrade React when this appears — dispatcher bugs get patched","Ensure a single react copy is loaded","Record React version + trace in your error reporting for issue filings"],"tags":["hooks","react-internal","invariant","suspense"],"backgroundTag":"react-internal-invariant","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}