Horje
react get route path Code Example
react get route path
import { useLocation } from 'react-router-dom'

function HeaderView() {
  const location = useLocation();
  console.log(location.pathname);
  return <span>Path : {location.pathname}</span>
}

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;
  }
}




Javascript

Related
google sheets translate Code Example google sheets translate Code Example
filter array with unique objects javascript Code Example filter array with unique objects javascript Code Example
unique objects in array javascript Code Example unique objects in array javascript Code Example
textarea react native Code Example textarea react native Code Example
NullInjectorError: No provider for HttpClient! Code Example NullInjectorError: No provider for HttpClient! Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10