Skip to content

useQueryParams Adds New History Entries When Updating Search Parameters #134

@rithviknishad

Description

@rithviknishad

Description:
When using useQueryParams hook to update search parameters, each update results in the addition of a new entry to the browser’s history.

Expected Behavior:
Ideally, updating search parameters should modify the current URL without creating a new history entry. This can be achieved by utilizing the window.history.replaceState() method.

Example:

const [query, setQuery] = useQueryParams();
setQuery({ page: 2 }); // Updates the URL's search and also adds a new history

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