Skip to content

When calling setState multiple times, only the last call takes effect #55

Open
@phparkle

Description

@phparkle

With React's useState hook, you can call setState multiple times and it will queue the updates, as long as you are passing a function to setState. However, in this library only the last call will take effect while all other calls will be effectively ignored.

Fortunately this is implemented properly in https://github.com/astoilkov/use-local-storage-state so you can use that library instead if you are running into this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions