Skip to main content

Data Mode

Data Mode adds powerful data loading and mutation features to React Router by moving route configuration outside of React rendering. This enables features like loaders, actions, pending states, and optimistic UI.

Quick Start

Why Data Mode?

Data Mode is ideal when you:
  • Want data loading features but don’t want a full framework
  • Need control over your bundler and server setup
  • Are migrating from React Router v6.4+
  • Want to integrate with existing build tools
Data Mode gives you the power of data loading without requiring the Vite plugin.

Route Configuration

Routes are configured as plain JavaScript objects:

Data Loading with Loaders

Loaders provide data to route components before they render:

Data Mutations with Actions

Actions handle form submissions and data mutations:

Pending UI States

Show loading states during navigation and submissions:

Fetchers for Parallel Mutations

Use useFetcher to load data or submit forms without navigation:

Advanced Patterns

Comparison with Framework Mode

Data Mode gives you full control over your build process while still providing powerful data loading features.

Next Steps