Answers for "react router dom link from current route"

4

react router Link does work

import { Link } from 'react-router-dom';
Posted by: Guest on October-16-2020
1

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 "react router dom link from current route"

Code answers related to "Javascript"

Browse Popular Code Answers by Language