我添加了重新渲染的修补程序,但是问题是它正在更新url中的先前路径名
shouldComponentUpdate(nextProps, nextState) {
return !isEqual(this.state, nextState)
}
和渲染
<Page.Content classes={`${styles.scrollable} flex flex--col flex--stretch`}>
<Switch>
<Route exact path={`${match.path}/bill`} component={() => Bill} />
<Route path={`${match.path}/invoice`} component={() => Invoices} />
<Redirect from="/charges" to={`${match.path}/bill`} />
</Switch>
</Page.Content>
仅显示${match.path}
而不是${match.path}/bill