I'm using react and am trying to link to another page using the tag. For example, I want to link back to the login screen with a parameter signupCompleted like so:
<Link to={{ pathname: '/', query: { signupCompleted: true } }}>
<Button bsStyle="primary" onClick="sendSignupRequest" className="pull-
right confirm-button-style">Send</Button>
</Link>
My component is routed to a path in my app.js:
<Route exact path='/' component={LoginPage} />
and in loginPage.js I try to reach the passed parameter in the constructor:
this.state = {
signupCompleted: props.signupCompleted,
};
However that is never set to true. I've looked at Pass props in Link react-router, but nothing seems to do the trick.
Any ideas?