{"record":{"id":"d521a4f9a7a86c19","repo":"facebook/react","slug":"startgesturetransition-should-not-be-exported-when","errorCode":null,"errorMessage":"startGestureTransition should not be exported when the enableGestureTransition flag is off.","messagePattern":"startGestureTransition should not be exported when the enableGestureTransition flag is off\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react/src/ReactStartTransition.js","lineNumber":127,"sourceCode":"              'that you cannot add to the outer Transition while inside the inner.' +\n              'This is a bug in React.',\n          );\n        }\n      }\n      prevTransition.types = currentTransition.types;\n    }\n    ReactSharedInternals.T = prevTransition;\n  }\n}\n\nexport function startGestureTransition(\n  provider: GestureProvider,\n  scope: () => void,\n  options?: GestureOptions & StartTransitionOptions,\n): () => void {\n  if (!enableGestureTransition) {\n    // eslint-disable-next-line react-internal/prod-error-codes\n    throw new Error(\n      'startGestureTransition should not be exported when the enableGestureTransition flag is off.',\n    );\n  }\n  if (provider == null) {\n    // We enforce this at runtime even though the type also enforces it since we\n    // use null as a signal internally so it would lead it to be treated as a\n    // regular transition otherwise.\n    throw new Error(\n      'A Timeline is required as the first argument to startGestureTransition.',\n    );\n  }\n  const prevTransition = ReactSharedInternals.T;\n  const currentTransition: Transition = {} as any;\n  if (enableViewTransition) {\n    currentTransition.types = null;\n  }\n  // $FlowFixMe[constant-condition]\n  if (enableGestureTransition) {","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react/src/ReactStartTransition.js#L109-L145","documentation":"startGestureTransition is gated behind the enableGestureTransition build flag; the export exists in the module but throws if invoked from a build where the flag is off. This is an internal invariant ensuring an unstable, flag-disabled API cannot be used accidentally from stable channels.","triggerScenarios":"Calling React.startGestureTransition (or importing it from 'react') in a build/channel where enableGestureTransition is false — typically the stable or classic release channel.","commonSituations":"Using experimental gesture/view-transition APIs documented against an experimental React build while running stable React; a bundler resolving 'react' to a different channel than intended after upgrading.","solutions":["Switch to a React experimental/canary build that has enableGestureTransition enabled (check ReactExperimentalChannel / flags for your version)","Remove the startGestureTransition call until the API ships enabled in your channel","Verify which React build your bundler resolves (areBuildsEqual / channel checks) so you are not mixing channels"],"exampleFix":"// before (stable react)\nimport {startGestureTransition} from 'react';\nstartGestureTransition(timeline, () => {...}); // throws\n\n// after\n// package.json: \"react\": \"experimental\", \"react-dom\": \"experimental\"\n// then the same call runs with the flag on","handlingStrategy":"validation","validationCode":"// Detect whether the API is usable in this build\nimport * as React from 'react';\nconst gestureSupported =\n  typeof React.startGestureTransition === 'function' &&\n  React.version.includes('experimental');\nif (gestureSupported) {\n  React.startGestureTransition(timeline, () => animate());\n} else {\n  animate(); // plain fallback path\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the react/react-dom versions to the experimental channel when using unstable APIs, and lock the lockfile","Check React.version/flags in a smoke test so a channel downgrade fails fast"],"tags":["experimental-api","feature-flag","gesture-transition","release-channel"],"backgroundTag":"feature-flag-disabled-api","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}