Skip to content
New issue

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

useLocalStorage and useSessionStorage don't reload when key is changed #5911

Closed
2 tasks done
israelins85 opened this issue Mar 12, 2024 · 1 comment · Fixed by #5910
Closed
2 tasks done

useLocalStorage and useSessionStorage don't reload when key is changed #5911

israelins85 opened this issue Mar 12, 2024 · 1 comment · Fixed by #5910

Comments

@israelins85
Copy link
Contributor

Dependencies check up

  • I have verified that I use latest version of all @mantine/* packages

What version of @mantine/* packages do you have in package.json?

7.6.2

What package has an issue?

@mantine/hooks

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

All

Describe the bug

When used a dynamic key and it changes, the value is not re-loaded.

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/mantine-react-template-forked-wk42tp?file=%2Fsrc%2FApp.tsx%3A6%2C2

Possible fix

pull

Self-service

  • I would be willing to implement a fix for this issue
@israelins85
Copy link
Contributor Author

israelins85 commented Mar 12, 2024

One practical example: in my site one customer can control and view data from MQTT device, at the connection layer I store the last data received on localStorage with on keys like ${uuid}/Sensors, and on view layer I read the data from current viewed device, and user can change the current device, and view the data from the other device, on Mantine 6 works, I migrated to Mantine 7 and broke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant