React Router Dom v6
import { useSearchParams } from 'react-router-dom'
//url = http://localhost:3000/main/ride?type=send
let [searchParams, setSearchParams] = useSearchParams();
console.log(searchParams.get('type')); // send
import { useLocation } from 'react-router';
import queryString from 'query-string';
const Dashboard: React.FC = React.memo((props) => {
const location = useLocation();
console.log(queryString.parse(location.search));
// {__firebase_request_key: "blablabla", _k: "v9ifuf"}
...
return <p>Example</p>;
}