Reputation: 21
I'm using React router and i would like to be able to send links or share it but everytime i realload the page, the state is becoming empty
http://localhost:3000/project/element=7/userid=9/exercises
If i enter this query in the url the state will not be preserved.
Here is my code:
<Route
exact
path="/project/element=:elementId/userid=:userid/exercises"
component={Exercises}
key={`exercises-id`}
/>
I tried to:
<Link to="/project/element=:elementId/userid=:userid/exercises" query={this.props.query}
But it's not preservering the state of my userId and elementId.
Here is the route:
<Route
exact
path="/project/element=:elementId/userid=:userid/exercises"
component={Exercises}
key={`exercises-id`}
/>
Thanks for the help
Upvotes: 1
Views: 291
Reputation: 229
path="/project/element=:elementId/userid=:userid/exercises"
Should be
path="/project/element/:elementId/userid/:userid/exercises"
inside
Upvotes: 1