{"record":{"id":"186ee7411223e0b3","repo":"facebook/react","slug":"detected-a-large-number-of-updates-inside-starttra-186ee7","errorCode":null,"errorMessage":"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.","messagePattern":"Detected a large number of updates inside startTransition\\. If this is due to a subscription please re-write it to use React provided hooks\\. Otherwise concurrent mode guarantees are off the table\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react/src/ReactStartTransition.js","lineNumber":197,"sourceCode":"    }\n  } catch (error) {\n    reportGlobalError(error);\n  } finally {\n    ReactSharedInternals.T = prevTransition;\n  }\n  return noop;\n}\n\nfunction warnAboutTransitionSubscriptions(\n  prevTransition: Transition | null,\n  currentTransition: Transition,\n) {\n  if (__DEV__) {\n    if (prevTransition === null && currentTransition._updatedFibers) {\n      const updatedFibersCount = currentTransition._updatedFibers.size;\n      currentTransition._updatedFibers.clear();\n      if (updatedFibersCount > 10) {\n        console.warn(\n          'Detected a large number of updates inside startTransition. ' +\n            'If this is due to a subscription please re-write it to use React provided hooks. ' +\n            'Otherwise concurrent mode guarantees are off the table.',\n        );\n      }\n    }\n  }\n}\n","sourceCodeStart":179,"sourceCodeEnd":206,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react/src/ReactStartTransition.js#L179-L206","documentation":"This is the shared warnAboutTransitionSubscriptions helper (ReactStartTransition.js:197), called in the finally block of React.startTransition. Each top-level startTransition scope gets a dev-only _updatedFibers set; fibers scheduling updates while ReactSharedInternals.T points at that transition are added by the work loop. If the scope ends with more than 10 distinct fibers updated, React warns that a subscription is likely inside the scope - updates React did not plan cannot be kept interruptible.","triggerScenarios":"import {startTransition} from 'react' and a scope that synchronously updates more than 10 components: startTransition(() => { selectedIds.forEach(id => setters[id](...)); }), or a store.emit()/notify() invoked inside the scope whose subscribers each setState.","commonSituations":"Multi-select UIs updating per-row state inside one transition; wrapping store commit functions in startTransition; transitions that trigger analytics listeners which themselves setState.","solutions":["Replace manual store subscriptions with useSyncExternalStore so scheduling belongs to React","Restructure to a single state update (one parent state object or reducer dispatch) per transition scope","Fire subscription notifications outside the transition, keeping only the intentional state change inside","Accept the dev-only warning if the fan-out is deliberate and you do not rely on interruption for that update"],"exampleFix":"// before\nstartTransition(() => {\n  store.notify(); // each listener setStates -> >10 fibers\n});\n\n// after\nstartTransition(() => {\n  setSelected(computeSelection(ids)); // one update\n});\n// listeners read via useSyncExternalStore(store.subscribe, store.getSnapshot)","handlingStrategy":"validation","validationCode":"// dev wrapper: assert scope size before entering startTransition\nfunction guardedStartTransition(scope) {\n  if (__DEV__ && scope.length > 0) {\n    console.warn('startTransition ignores arguments - a subscription may be involved');\n  }\n  startTransition(scope);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read external stores through useSyncExternalStore, never subscribe-and-setState in transitions","Audit startTransition scopes for callbacks that notify listeners","Limit each scope to one intentional state change and let selectors handle the fan-out"],"tags":["start-transition","subscriptions","concurrent-mode","performance","dev-only"],"backgroundTag":"starttransition-too-many-updates","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}