react-storage-context is a React library that provides a context-based API for reading and writing to localStorage and sessionStorage. Version 1.0.1 is the current stable release. It uses React's Context API to manage storage values and exposes a higher-order component (@StorageContext) and a consumer component to access storage data. Differentiators include simple decorator syntax and both local and session storage support in a single package. However, the package is unmaintained since 2019, with no TypeScript support and limited community adoption.
npm install react-storage-contextNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up StorageContext decorator, use withStorageContext HOC, and use Consumer to read storage.
Ensure the root component is decorated with @StorageContext('your-id') before using withStorageContext or Consumer.Use a unique string identifier for each app, e.g., 'my-app-123'.
Consider migrating to modern alternatives like 'use-local-storage' or 'react-storage-hooks' that support hooks and are actively maintained.
Run 'yarn add react-storage-context' or 'npm install react-storage-context'.
Ensure the parent component is decorated with @StorageContext.
Enable decorators in Babel: add '@babel/plugin-proposal-decorators' with 'legacy: true'.
No dependency data recorded yet.