A utility library for caching client data in React Router applications, currently at version 3.0.0. It provides hooks and components to cache server data client-side, reducing redundant fetches and improving perceived performance. Released actively. Key differentiators: designed specifically for React Router v7+, leverages React 18/19 concurrent features, supports both ESM and TypeScript out of the box. Alternative to manual SWR or React Query setups with Router integration.
npm install remix-client-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows wrapping app in CacheProvider and using useCache hook to fetch and cache data with a TTL of 5 minutes.
Wrap your application with <CacheProvider> at the root level.
Upgrade to React Router v7 or stay on remix-client-cache@2.x.
Migrate to options object format: useCache('key', fetcher, { ttl: 5000 }).Use descriptive keys that include route or component info, e.g., 'user-profile' instead of 'data'.
Use import syntax or configure your environment for ESM.
Wrap app in <CacheProvider>.
Use import { useCache } from 'remix-client-cache' instead of require().Ensure the component is inside <CacheProvider>.