A React hook library for fetching and caching remote data with stale-while-revalidate strategy. Version 2.0.1 ships TypeScript types and supports multiple storage backends: MemoryStore, StorageStore (localStorage/sessionStorage), IndexedDBStore, and CacheStore. It differentiates from SWR by offering built-in IndexedDB support for large persistent caches exceeding 10GB. Install via npm; peer dependency on React >=16.8.0. Release cadence: occasional updates.
npm install react-fast-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage of useFetch, FetchProvider, and MemoryStore with a custom fetcher
Use MemoryStore or StorageStore for latency-sensitive caches
Switch to IndexedDBStore for larger data or handle quota errors gracefully
Use import syntax or dynamic import() in Node.js with "type": "module"
Use FetchProvider component instead
Set preserve: false to clear data on URL change, or show a loading indicator
Check loading state before accessing data properties: if (loading) return <Spinner />; return <div>{data.version}</div>Increase limit when instantiating the store: new MemoryStore({ limit: 5000 })Use IndexedDBStore or CacheStore instead of StorageStore, or reduce cache size
Switch to import syntax or enable ESM in your project ("type": "module" in package.json)