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 after the redirect from their servers?
http://localhost:8000/#/signin?_k=v9ifuf&__firebase_request_key=blablabla
I tried with the following routes configuration, but the :redirectParam is not catching the mentioned param:
In react-router-dom v6 there is a new hook called useSearchParams. So with const [[search] , setSetSetSearch Params] = use SearchParAMs(); searchParamas.get(\”__firebase_request_key\”).\n\nThis is a case of searchParams, which also implements an iterator, e.g., for use of Object.fromEntries etc. React Router v4/v4, which does not parse the query for you further, but you can only access it through this.props.location.search (or useLocation: ).\n\nAnother library would be query-string. See this answer for more parsing of the search string. If you don\’t need IE-compatibility you can also use new URLSearchParams(this.props.location.search).get(\”__firebase_request_key\”).\n\nIf you would use the hook useLocation to replace this.props.location with the React rendering on changes. Note: If this is not a direct child of the router provided by Router to access any of its location for you and passes it to your RouteComponent as props, you can access the query (after )?\n\nThese are available via this.props.match.params,redirectParam, if you are looking for the path parameter values, separated by a colon (:) inside the router.\n\nThis applies to late React Router v3 versions (not sure which) Older router versions were reported to use this.props.params,redirectParam. General nizam .sp\’s suggestion to do console.log(this. Props).\n\nAny case, will be a good paraphrase.