import React from "react";
import { useLocation } from "react-router-dom";
const MyComponent = () => {
const search = useLocation().search;
const id=new URLSearchParams(search).get("id");
console.log(id);//12345
}
//in route
<Route path="child/:id" children={<Child />} />
// in component
import { useParams } from "react-router-dom";
let { id } = useParams();
const [searchParams, setSearchParams] = useSearchParams();
searchParams.get("__firebase_request_key")
<Route path="/users/:id" render={(props) => <UserPage {...props} />}/>
this.props.match.params.id