
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
storagehooks
Advanced tools
React hooks for accessing state in `localStorage` and `sessionStorage`, with support for encoding values as JSON and tracking `storage` events
React hooks for connecting component state to state in localStorage and
sessionStorage.
Features:
localStorage and sessionStoragestorage event supportuseState())
Import useLocalStorage or useSessionStorage (based on your preferred Web
Storage location)
import {useLocalStorage, useSessionStorage} from 'storagehooks';
function myComponent(props) {
// Use it like `useState()`, but provide name of storage key as the first argument
const [localValue, setLocalValue] = useLocalStorage('myKey', 'initial value');
const [sessionValue, setSessionValue] = useSessionStorage('myKey', 'initial value');
return <>
<label>Value in localStorage:</label>
<input value={localValue} onChange={e => setLocalValue(e.target.value)} />
<label>Value in sessionStorage:</label>
<input value={sessionValue} onChange={e => setSessionValue(e.target.value)} />
</>;
}
key | (String) key in storage where value is saved |
initialValue | (any) initial value (passed to useState()) |
options.listen | If true (the default), a listener is used to update the value in response to "storage" events |
options.dispatch | If true (the default), a "storage" event is dispatched to the current window when the value is changed |
| returns | [value, setValue] tuple, just like useState() |
FAQs
React hooks for accessing state in `localStorage` and `sessionStorage`, with support for encoding values as JSON and tracking `storage` events
The npm package storagehooks receives a total of 0 weekly downloads. As such, storagehooks popularity was classified as not popular.
We found that storagehooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.