Skip to content
This repository was archived by the owner on May 20, 2022. It is now read-only.
This repository was archived by the owner on May 20, 2022. It is now read-only.

Feature Request: could setState mirror react.setState functionality? #49

@njsaeli

Description

@njsaeli

Unless I am mistaken,

Currently React.setState will accept either the new state or a function which accepts the old state and return the the new state, while the react-hookstore version of setState will only accept the new state, as well as having the optional callback.

could the react-hookstore version be adjusted to allow for the function to be accepted in place of the state value?

Based on what I've looked at in the source code, the only thing preventing this from working seems to just be a typing issue? Unless i'm missing something I believe hookstore is using the react.setState everywhere under the hood.

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