Location
All information about the current URL besides splats and params can be found in the location
object, which is accessible through the useLocation hook.
Always use this hook instead of using window.location
directly, as
concurrent rendering with react causes multiple different locations to exist
at the same time.
function Route() {
let location = useLocation()
...
}
Location is an instance of URL, so take a look at this native web platform api if you are not familiar.