-1

I have following routes in the application:

<Switch>
    <Route path="/shops/:id">
       <StoreDetails/>
    </Route>
    <Route path="/shops">
        <Stores/>
    </Route>
   <Route path="/">
      <Home/>
   </Route>
</Switch>

how do I deep link /shops and /shops/:id URLs??

reactdesign
  • 167
  • 1
  • 11
  • Duplicate : https://stackoverflow.com/questions/35352638/react-how-to-get-parameter-value-from-query-string – 1pulsif Mar 17 '20 at 07:29

1 Answers1

2

whith hooks :

import React from 'react';

export const test = props => {
 const { match } = props;
 const id = match.params.id;

 return <></>;
};
1pulsif
  • 471
  • 4
  • 14