A react-admin data provider that stores data in the browser's localStorage, enabling local-first apps and testing without a backend. Version 5.14.7, released as part of the react-admin ecosystem. Uses FakeRest internally for filtering, sorting, pagination, and full-text search. Supports cross-tab persistence, optional logging, and configurable localStorage keys and update delays. Default data can be seeded via the `defaultData` option.
npm install ra-data-local-storageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
A minimal react-admin app using a local storage data provider with seeded default data.
Consider using `useDataProvider` in a custom app component to populate initial data.
Reduce `localStorageUpdateDelay` to 0 for immediate persistence, or ensure data is flushed before unload using `beforeunload` event.
Monitor localStorage usage and consider alternative storage (e.g., IndexedDB) for large amounts of data.
Design your app to refresh data periodically or after a write to ensure consistency.
Ensure your project is configured for ES modules. Use `import localStorageDataProvider from 'ra-data-local-storage'` instead of `require()`.
Ensure you call `localStorageDataProvider()` and pass the result as the `dataProvider` prop: `<Admin dataProvider={dataProvider}>`.Ensure every resource object in `defaultData` has a unique `id` field.