monkeydeveloper monkeydeveloper - 1 year ago 258
React JSX Question

react-router: How to get parameter value from URL

How can I define a route in my routes.jsx file to capture the __firebase_request_key parameter value from an URL generated by twitter single sign on process after the redirect from their servers?


I tried with the following routes configuration but the :redirectParam is not catching the mentioned param:

<Route path="/" component={Main}>
<Route path="signin" component={SignIn}>
<Route path=":redirectParam" component={TwitterSsoButton} />


Answer Source

React Router already parses the location for you. You can access it via


nizam.sp's suggestion to do


will be helpful in any case.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download