React - How to get parameter value from query string?

后端 未结 30 2229
温柔的废话
温柔的废话 2020-11-22 10:22

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

30条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 10:58

    When you work with react route dom then will empty object with for match but if you do the following code then it will for es6 component as well as it works directly for function component

    import { Switch, Route, Link } from "react-router-dom";
    
    
     {
        return ;
      }}
    />
    
    

    This way you can get props and match params and profile id

    This worked for me after a lot of research on es6 component.

提交回复
热议问题