We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useLocalStorageValue
data:
Nope
When you load a page via a data: url that uses useLocalStorageValue, the hook crashes with the current error:
Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
I'm not sure of the best way to reproduce this. My team hits the bug when we accidentally hit our frontend via Insomnia.
I really don't know. At least not crash, probably, but I don't know what results the hook should give, if any.
I'm mostly making this report in case anyone else hits this bug.
@react-hookz/web
react
react-dom
typescript
The text was updated successfully, but these errors were encountered:
Guesss we have to fallback to undefined in case of inaccessibility of storages
undefined
Sorry, something went wrong.
fix: replace hook with noop in case of storage absence.
9a38a9c
fix: #521
useLocalStorage
useSessionStorage
790b302
chore(release): 12.1.1 [skip ci]
2176a3e
## [12.1.1](v12.1.0...v12.1.1) (2022-01-11) ### Bug Fixes * **`useLocalStorage`, `useSessionStorage`:** replace hook with noop in case of storage absence. ([#540](#540)) ([790b302](790b302)), closes [#521](#521)
🎉 This issue has been resolved in version 12.1.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
No branches or pull requests
Prior Issues
Nope
What is the current behavior?
When you load a page via a
data:
url that usesuseLocalStorageValue
, the hook crashes with the current error:Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
Steps to Reproduce
I'm not sure of the best way to reproduce this. My team hits the bug when we accidentally hit our frontend via Insomnia.
What is the expected behavior?
I really don't know. At least not crash, probably, but I don't know what results the hook should give, if any.
I'm mostly making this report in case anyone else hits this bug.
Environment Details
@react-hookz/web
version: 12.0.0react
version: 17.0.2react-dom
version: 17.0.2typescript
version: n/aThe text was updated successfully, but these errors were encountered: