Skip to content

Commit

Permalink
docs: fix the url of router event (#51339)
Browse files Browse the repository at this point in the history
Refer to [here](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString#examples)

The `searchParams.toString()` doesn't include the question mark.


Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
  • Loading branch information
jyunhanlin and balazsorban44 committed Jun 15, 2023
1 parent 831f58a commit e43f134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/02-app/02-api-reference/04-functions/use-router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function NavigationEvents() {
const searchParams = useSearchParams()

useEffect(() => {
const url = pathname + searchParams.toString()
const url = `${pathname}?${searchParams}`
console.log(url)
// You can now use the current URL
// ...
Expand Down

0 comments on commit e43f134

Please sign in to comment.