useLocation in v4
I'm using
but got Uncaught Error: useLocation() may be used only in the context of a <Router> component.
but got Uncaught Error: useLocation() may be used only in the context of a <Router> component.
const location = useLocation()
const { products, code } = location.state as any