Returns a tuple of the current URL's URLSearchParams and a function to update them. Setting the search params causes a navigation.
import { useSearchParams } from "react-router";export function SomeComponent() { const [searchParams, setSearchParams] = useSearchParams(); // ...} Copy
import { useSearchParams } from "react-router";export function SomeComponent() { const [searchParams, setSearchParams] = useSearchParams(); // ...}
Optional
Returns a tuple of the current URL's URLSearchParams and a function to update them. Setting the search params causes a navigation.