[]previous and next page

registerTransitionLane

Installs the transition machinery (the transition lane, Activity pauses and Suspense holds) now instead of at the first startTransition.

Installs the transition machinery (the transition lane, Activity pauses and Suspense holds) now instead of at the first startTransition. The machinery is created on first use so that an application that never uses transitions does not carry its code; call this from a primitive whose later work needs the lane to exist, as useDeferredValue does. Calling it again does nothing.

Import#

ts
import { registerTransitionLane } from "@shadow-js/core/extend";

Signature#

ts
function registerTransitionLane(): void

Examples#

ts
import { registerTransitionLane } from "@shadow-js/core/extend";

export function useBackgroundValue(): void {
  registerTransitionLane(); // later lane-only effects of this hook find the lane
}