-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
regression in 7.6.1
#5848
Comments
Hey @dfaust, how are you doing? Do you think you could provide a
Otherwise, what are you trying to achieve? A codesandbox with a minimal reproduction should help too. Thanks! |
Hi @lgaspari, I don't want to have a default value. I want If |
Gotcha, now I understand why this is a regression for you, @dfaust. It might be related to a concern I raised on the linked issue (see #5796 (comment)) where you ALWAYS get the default value on return, therefore, this side-effect isn't called. In other words, even though my issue was solved, I strongly believe that there are other use cases that aren't considered and might be broken as your case. I'll give it a try on my end to see if I can help solve your issue while keeping it working for me as well 😄 |
I have the same use case as @dfaust I need the |
@dfaust @wassim I've created a fork repository and addressed the issue in there. I'd appreciate if you could give it a try. In order to do so, please follow these steps:
I've covered only 8 scenarios which look similar but they work differently as the following (not in the same order as stories):
I'll wait for your feedback before creating a pull request :) — if in any case you cannot try it, please let me know. |
…the local storage when `defaultValue` is not defined (#5848)
Fixed in 7.6.2 |
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.6.1
What package has an issue?
@mantine/hooks
What framework do you use?
Vite
In which browsers you can reproduce the issue?
Firefox
Describe the bug
useLocalStorage
stores 'undefined' while loading a value.Reverting
@mantine/hooks
to7.6.0
fixes the problem:I assume this is related to #5796.
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
No response
Self-service
The text was updated successfully, but these errors were encountered: