Accessing Location Within @reach/router
import React from 'react';
import { Location } from '@reach/router';
const MyComponent = () => {
return (
<Location>
{({ location }) => {
return <p>Current Location: {location.pathname}</p>;
}}
</Location>
);
}Last updated