Skip to main content

Overview

React’s concurrent features allow you to keep your app responsive during expensive updates. These features include transitions, deferred values, and concurrent rendering, which help prioritize urgent updates over less important ones.

Transitions

Transitions allow you to mark updates as non-urgent, keeping the UI responsive during expensive operations.

useTransition Hook

From packages/react/src/ReactHooks.js:170:

Basic Usage

startTransition API

From packages/react/src/ReactStartTransition.js:45:

Standalone startTransition

Use startTransition outside of components:

Transition Internal Implementation

From packages/react/src/ReactStartTransition.js:30:
Transitions track:
  • types: View transition types (experimental)
  • gesture: Gesture providers (experimental)
  • name: Debug name for transition tracing
  • startTime: When the transition started
  • _updatedFibers: Fibers updated during transition (dev only)

Deferred Values

Deferred values let you defer updating a part of the UI until more urgent updates have finished.

useDeferredValue Hook

From packages/react/src/ReactHooks.js:178:

Basic Usage

With Loading Indicator

Transition vs Deferred Value

Use useTransition when:
  • You control the state update
  • You want to show pending state
  • You need to start transitions imperatively
Use useDeferredValue when:
  • You receive a value from props or another hook
  • You want to defer rendering of received values
  • You want to show stale content during updates

Practical Examples

Tab Switching

Search with Debounced Results

Router Navigation

Optimistic Updates

Transition Warning

From packages/react/src/ReactStartTransition.js:193, React warns about excessive updates in transitions:
Avoid subscribing to external stores inside transitions. Use React’s hooks instead.

Async Transitions

From packages/react/src/ReactStartTransition.js:82, transitions can be async:

Gesture Transitions (Experimental)

From packages/react/src/ReactStartTransition.js:119:
This API is experimental and not yet stable. Async functions are not supported in gesture transitions.

Best Practices

  1. Prioritize user input: Keep input updates outside transitions
  2. Show loading states: Use isPending to provide feedback
  3. Memoize expensive computations: Combine with useMemo and memo
  4. Avoid transition abuse: Don’t wrap everything in transitions
  5. Test on slow devices: Transitions are most valuable on slower hardware
  6. Use appropriate indicators: Show subtle indicators for deferred updates
  7. Handle errors: Transitions can fail, handle errors appropriately

Performance Considerations

  1. Interruption: Transitions can be interrupted by urgent updates
  2. Batching: React batches multiple transition updates
  3. Priority: Urgent updates always take priority over transitions
  4. Memory: Transitions keep old UI in memory briefly

Debugging Transitions

See Also

  • Suspense - Loading states for async operations
  • Hooks - All available React hooks
  • Performance - Optimization techniques