useLocation returns the current location object. If a navigation included state, the receiving route can access it through location.state.