The settings are as follows:
<Route path="/first" component={First} />
<Route path="/first/:id" component={FirstDetail} />
The problem is: when the first page jumps to the first:/id page, the page will not be refreshed and the content will be appended. Is there any good method? , these two routes correspond to different pages
代言2017-06-22 11:56:24
import {Switch} from 'react-router-dom';
....
<Switch>
<Route path="/first" exact component={First} />
<Route path="/first/:id" component={FirstDetail} />
</Switch>