render() {
if(this.state.verified){
return(<div>Verified</div>)
}else {
return(<Redirect to='/'/>)
}
}
This is producing an error < Redirect> elements are for router configuration only and should not be rendered
This is how i understood rerouting should be done from react router docs. What is wrong with the code above and how should conditional re-routing done in react?