How can I define a route in my routes.jsx file to capture the __firebase_request_key
parameter value from a URL generated by Twitter\'s single sign on process a
React Router 5.1+
5.1 introduced various hooks like useLocation and useParams that could be of use here.
Example:
Then if we visited say
http://localhost:3000/test/signin?_k=v9ifuf&__firebase_request_key=blablabla
You could retrieve it like
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 Example
;
}