Skip to content

useLocalStorage not updating correctly with multiple calls #345

@svengau

Description

@svengau

if you ask multiple time to update local storage, only the last call is applied.

I've done a a codepen to illustrate the issue, with a fix using a ref (thanks to Grok):

https://codesandbox.io/p/devbox/serene-monad-7wzycc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions