I am getting undefined value when passing the value through navigate.
Code to send a value to home Component
if(result.status === 200)
{
if(user.work === "Worker")
{
navigate("/home", {
mail:user.email
});
}
}
Routing Code
<Router>
<Routes>
<Route path="/home" element={<Home />} />
</Routes>
</Router>
Home Component
const { location } = useLocation();
console.log(location);