Note: I'm trying to switch to Plug'n'Play using yarn.
useLocation is imported from 'react-router-dom' package.
Previously (before pnp settings) the line below:
const location = useLocation()
always returned a location object with the next structure (e.g):
{pathname: '/', search: '', hash: '', state: null, key: 'default'}
With current yarn pnp settings, build renders app when on the first render, there is a location object with the structure as above, but when trying to change path, there is an object with the next structure (e.g.):
{action: 'PUSH', location: {pathname: '/new-path', search: '', hash: '', state: null, key: 'default'}}
Why is it so, and how to fix it (to always have a location object returned by useLocation hook of the same structure)?