state = {
heading:"a"
}
componentDidUpdate=async(prevProps,prevState)=>{
if(prevState.heading!==this.state.heading){
// use this.setState
}
}
<Route path="/" exact component={A}/>
<Route path="/b" exact component={B}/>
<Route path="/c" exact component={C}/>
I want to change heading to b and c according to the route. I don't know how to use "match" or "params" here in route