Routes look like:
<Route path="/" exact component={Landing} />
<Route path="/Buyer" exact component={Buyer} />
<Route path="/Seller" exact component={Seller} />
And inside of Landing I have a conditional Redirect that redirects to either buyer or seller which flows like:
<Button fluid onClick={this.routeChange}>Seller</Button>
routeChange(e) {
this.setState({navigateTo: `/${e.target.textContent}`})
}
if (this.state.navigateTo.length > 0) {
return <Redirect to={this.state.navigateTo} />
}
This works. But, after I redirect, if I hit the back button it seems I have no history of having been at my "/" route. So my back button takes me to wherever I was before that.
What am I missing here?