Answers for "how to get url parameter react router dom"

1

react router base url

<BrowserRouter basename="/calendar"/>
<Link to="/today"/> // renders <a href="/calendar/today">
Posted by: Guest on June-12-2020
0

get current url react router

import {withRouter} from 'react-router-dom';

const SomeComponent = withRouter(props => <MyComponent {...props}/>);

class MyComponent extends React.Component {
  SomeMethod () {
    const {pathname} = this.props.location;
  }
}
Posted by: Guest on May-21-2020

Code answers related to "how to get url parameter react router dom"

Code answers related to "Javascript"

Browse Popular Code Answers by Language