I've tried a lot of examples from React Router documentation, Stackoverflow answers and posts on the web, but couldn't get anything working.
Here's what I have now:
<Link to={{
pathname: "/project",
state: { id: "id0" }
}}>Passing Props</Link>
and
<Route path="/project" component={Project} />
and state is undefined here:
function Project(params) {
console.log("passprops");
console.log(params);
// state is undefined in params
I've also tried passing with "/project/:id" and render={(props) => } but it didn't work too.
How to pass props/params/state to a Route with Link in React Router 5.2.0?