I'm shifting to react-router-dom v6 from react-router-dom v5. But there is something I wanna do but I'm not sure of it. As the Redirect Component is not found in the react-router-dom v6 and you gotta use the navigate.
This is the code i'm getting confused on:
{...rest}
render={(props) =>
authenticated ? (
<Redirect
to={{ pathname: `/dashboard`, state: { from: props.location } }}
/>
) : (
<Component {...props} />
)
}
/>
So in this case, would you like to help me out?