I am using React Router hooks for navigation useHistory
.
Navigate : history.push("/home", { update: true });
In home : I am trying to get params let {update} = useParams();
But update
is always undefined. Whats wrong with this code. Any suggestions ?
This is how you can pass
history.push("/home", { update: true });
and access like this if it's stateless component.
props.location.state.update;
if class based component.
this.props.location.update;