Skip to content

Limitation #19

@mtiller

Description

@mtiller

In practice, I have found that I cannot use useQueryString inside multiple hooks. The updates are done in such a way that the updates conflict with each other. Normally, the setter returned from a hook has a variant with is a callback where it passes you the current value and you override that. The useQueryString result indeed includes such a variation, but the data it passes in appears to be out of date.

My solution was to use useQueryString in exactly one place and then pass the return value down into other hooks in order for them all to share a single instance of QueryStringResult. That appears to work although it isn't obvious this is necessary. Or perhaps I missed something in the documentation.

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