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 missing dependencies #5910

Merged
merged 1 commit into from Mar 26, 2024

Conversation

israelins85
Copy link
Contributor

@israelins85 israelins85 commented Mar 12, 2024

Fixes #5911

When key or other value is changed the value is not reloaded
@rtivital
Copy link
Member

What real problem do you have that this PR fixes?

@israelins85
Copy link
Contributor Author

When key is changed the value is not loaded.

@israelins85
Copy link
Contributor Author

fixes #5911

@rtivital rtivital merged commit ec1adbf into mantinedev:master Mar 26, 2024
@rtivital
Copy link
Member

Thanks!

@gl3nn
Copy link
Contributor

gl3nn commented Apr 2, 2024

@rtivital @israelins85 This PR broke all of our usages of it and thus can't update to 7.7.1. Would be nice in the future to show example code on what your issue was and why this would fix it.

@rtivital
Copy link
Member

rtivital commented Apr 2, 2024

It would be reverted in next patch

@israelins85
Copy link
Contributor Author

It would be reverted in next patch

What's happened?

@israelins85
Copy link
Contributor Author

@rtivital @israelins85 This PR broke all of our usages of it and thus can't update to 7.7.1. Would be nice in the future to show example code on what your issue was and why this would fix it.

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

What's broken?

@israelins85
Copy link
Contributor Author

israelins85 commented Apr 2, 2024

I use localStorage to store data from many devices key is like ${uuid}/Sensors and when user changes the current uuid the data of the current need be loaded...

@israelins85
Copy link
Contributor Author

#6019

@icflorescu
Copy link
Contributor

@rtivital @israelins85 @gl3nn this also broke Mantine DataTable on Mantine 7.7.1, see this issue: icflorescu/mantine-datatable#564 😑

We're using the useLocalStorage hook to persist column resizing/ordering state, and it gets triggered infinitely with the same values:
image

Would be nice to see #6019 pulled...

@rtivital
Copy link
Member

rtivital commented Apr 4, 2024

I've reverted it, the fix will be available in next patch

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 this pull request may close these issues.

useLocalStorage and useSessionStorage don't reload when key is changed
4 participants