-
-
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 causes infinite re-renders #6017
Comments
i was just typing the same issue when this popped up. if you use simple values like string this doesn't happen, but when you use an object and the deserialize is triggered it runs into an infinite loop. |
👍 We're seeing the same on our side. |
i prepared a fix here: #6019 |
I think you probably meant v7.7.1 (and v7.7.0 respectively), do you? If so, I'm experiencing the same issue you're describing. |
bug was introduced in ec1adbf (so only 7.7.1 should be effected) after my fix it is still needed to memorize the serialize and deserialize if overwriting them in your own code. |
if you need a workaround until fixed in the codebase, you just need to overwrite the
|
found the same issue, got stuck on it for 3 hours - thanks for reporting and fixing @wuifdesign ❤️ |
The same issue breaks Mantine DataTable on Mantine 7.7.1, see icflorescu/mantine-datatable#564 - many thanks for investigating and coming up with the fix! |
Having the same issue |
Fixed in 7.7.2 |
Thanks a lot, @rtivital! |
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.7.1
What package has an issue?
@mantine/hooks
What framework do you use?
Vite
In which browsers you can reproduce the issue?
Chrome
Describe the bug
v7.7.1 break my useLocalStorage states. The following PR updates the memo dependencies and causes infinite re-renders.
https://github.com/mantinedev/mantine/pull/5910/files
I suspect that the useEffect on Line 145 causes this.
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
Revert memo dependencies back to how they were in v7.7.0
Self-service
The text was updated successfully, but these errors were encountered: