React - How to get parameter value from query string?

后端 未结 30 2001
温柔的废话
温柔的废话 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:57

    React Router v5.1 introduced hooks:

    For

    
      
    
    

    You can access params / id with hook:

    const { id } = useParams();
    

    More here.

提交回复
热议问题