Skip to content

[Bug]: Query string before the hash is not read using useSearchParams #9027

@TomGB

Description

@TomGB

What version of React Router are you using?

react-router-dom@6.3.0

Steps to Reproduce

const [searchParams, setSearchParams] = useSearchParams();
console.log(Array.from(searchParams.entries()));

visit localhost:3000/?foo=bar#/home

Expected Behavior

[["foo", "bar"]]
is logged

Actual Behavior

[]
is logged

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions