useLocalStorage()
doesn't re-load from localStorage
when key
changes
#7286
Labels
Fixed patch
Completed issues that will be published with next patch (1.0.X)
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.15.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
useLocalStorage()
doesn't re-load fromlocalStorage
whenkey
changesas a workaround, a
key
prop can be usedoddly enough, if two usages of
useLocalStorage()
are used with the samekey
and thekey
prop workaround is used on the second one then the old value will flicker but will change while if it is used on the first one (like in the demo and screenshot) then the non-workaround value will not update even though it shouldIf possible, include a link to a codesandbox with a minimal reproduction
https://codesandbox.io/p/sandbox/mantine-react-template-forked-clnqdp
Possible fix
there may be some missing hook dependency that should use the incoming
key
value to the hookSelf-service
The text was updated successfully, but these errors were encountered: