#37712·React

Bug: addTransitionType types are claimed by an unrelated commit while the transition is suspended

Author: jeffstahlinCreated Sep 29, 2026Updated Sep 29, 2026

Types added with addTransitionType are handed to whichever view-transition commit runs first, not to the commit that contains the transition's update. While a typed transition is suspended, an unrelated commit, such as a Suspense boundary revealing elsewhere, takes its types. The transition then commits with types: null, so <ViewTransition share={{ forward: "…", default: "none" }}> resolves to none and nothing animates. The types end up on the wrong animation.

React version: 19.3.0 (also 19.3.0-canary-7c6ac13e-20260929)

Steps To Reproduce

  1. Render the example below in Chrome.
  2. Click Next.
  3. Watch the console.

Link to code example:

javascript
import { Suspense, ViewTransition, addTransitionType, startTransition, use, useState } from "react";
import { createRoot } from "react-dom/client";

// Log the types React passes to each view transition.
const start = document.startViewTransition.bind(document);
document.startViewTransition = (options) => {
  console.log("startViewTransition types:", JSON.stringify(options.types ?? null));
  return start(options);
};

const later = (ms, value) => new Promise((resolve) => setTimeout(resolve, ms, value));
const ready = (value) => Object.assign(Promise.resolve(value), { status: "fulfilled", value });

function Text({ data }) {
  return <p>{use(data)}</p>;
}

function App() {
  const [page, setPage] = useState({ n: 1, data: ready("page 1") });
  const [widget, setWidget] = useState({ n: 0, data: ready("widget") });

  function next() {
    // Something unrelated starts loading behind a Suspense boundary; it's ready after 200 ms.
    setWidget({ n: widget.n + 1, data: later(200, "widget") });
    // A typed transition whose data takes 400 ms.
    startTransition(() => {
      addTransitionType("forward");
      setPage({ n: page.n + 1, data: later(400, `page ${page.n + 1}`) });
    });
  }

  return (
    <>
      <button onClick={next}>Next</button>
      <Suspense key={widget.n} fallback={<p>loading widget</p>}>
        <Text data={widget.data} />
      </Suspense>
      <ViewTransition>
        <h1>Page {page.n}</h1>
      </ViewTransition>
      <ViewTransition key={page.n} name="page" share={{ forward: "slide-forward", default: "none" }} default="none">
        <div>
          <Text data={page.data} />
        </div>
      </ViewTransition>
    </>
  );
}

createRoot(document.getElementById("root")).render(<App />);

The current behavior

On every click (10 of 10 on each version, production builds, Chrome):

startViewTransition types: ["forward"]   <- the widget's Suspense reveal, a retry-lane commit at ~300 ms
startViewTransition types: null          <- the page's transition, which called addTransitionType("forward")

Remove the setWidget(...) line and the page's transition gets ["forward"] every time.

The types live in one set per root (root.transitionTypes), and commitRoot claims the whole set for any commit whose lanes are all transition, retry or idle lanes. The suspended transition's lane is in suspendedLanes, so getNextLanes renders the retry lane on its own. That commit takes the types first. #32797 mentions this simplification ("Really each transition lane should get its own set").

The expected behavior

The types reach the commit that contains the update from the startTransition that added them (here, the page's), not an unrelated commit that happens to run first.

How it shows up in Next.js, with no unrelated update

We hit this with Next.js 16.3.5 <Link transitionTypes={["nav-forward"]}>. In a production build about 1 navigation in 20 lost its slide, and nearly all did when the response body was handed to the router one Flight row per task. There is no unrelated update there. The commit that takes the types is an empty one, for a useDeferredValue lane spawned during the navigation's own render:

  1. Next's InnerLayoutRouter calls useDeferredValue(cacheNode.rsc, resolvedPrefetchRsc). When it mounts, mountDeferredValueImpl spawns a deferred lane D, even though the initial value equals the value.
  2. The navigation lane L was suspended in an earlier attempt. A later render of L is pinged partway through (workInProgressRootPingedLanes) and then suspends again on a Flight row that hasn't arrived.
  3. markRootSuspended removes the pinged L before calling markSpawnedDeferredLane(root, D, suspendedLanes). So D is tied to nothing and isn't suspended.
  4. getNextLanes prefers D, which isn't suspended, over the pinged but still-suspended L. D renders with no work, commits, and claims the types. L commits about 2 ms later and calls startViewTransition({ types: null }).
Lane trace from one navigation (ms after the click; lanes as bit strings; recorded through a stub DevTools hook)
   1.4  pendingLanes += 1000000000 (L)                          queue ["nav-forward"]
   4.5  suspendedLanes += L;  4.8 pendingLanes += bit 19 (D1, tied to L)
 318.0  ping L (headers);  318.7 pendingLanes += bit 20 (D2, tied to L)
1249.4  ping L, D2, D1 (body)
1251.9  pendingLanes += bit 21 (D3) from markRootSuspended, with no change to suspendedLanes (L was pinged mid-render)
1252.2  commit lanes {19, 20, 21}; L still pending  -> claims ["nav-forward"]; the old page is still on screen
1254.3  commit L                                     -> claims null -> startViewTransition({ types: null })

Tracking types per lane, or claiming them only in a commit that includes the lanes they were queued with, would fix both cases.