Skip to main content

Client-Side Data Loading

React Router provides several ways to load and manage data entirely on the client, enabling progressive enhancement, caching strategies, and hybrid server/client data patterns.

Client Loaders

Use clientLoader to fetch data only on the client:

Combining Server and Client Loaders

Call server loader from client for hybrid loading:

Client-Side Caching

Time-Based Cache

Local Storage

IndexedDB

Prefetching Data

Client Actions

Handle mutations entirely on the client:

Optimistic Client Updates

Background Sync

Progressive Enhancement

Hydration

Control hydration behavior:

React Query Integration

SWR Integration

Best Practices

Cache Invalidation

Error Boundaries

Loading States