通过最外层路由配置文件匹配路由 /auth-apply 进入这个页面(路由 /auth-apply的配置中未加 exact),然后需要重定向到/auth-apply/add-info 这个子路由,下面这种代码编写运行的情况是能正常进入这个页面,重定向的时候地址栏中的路径是变成了 /auth-apply/add-info ,但就是对应的 AuthForm 组件的内容没有渲染出来,GlobalLayout中是一片空白,这是什么原因?麻烦大佬指点一下。多谢🙏🏻
render() {
return (
<div className={styles.AuthApply}>
<GlobalLayout history={this.props.history}>
<Switch>
<Route exact path="/auth-apply/add-info">
<AuthForm {...this.props} />
</Route>
<Route path="/auth-apply/result">
<AuthResult {...this.props} />
</Route>
<Route
path="/auth-apply"
render={() => <Redirect to="/auth-apply/add-info" push />}
/>
</Switch>
</GlobalLayout>
</div>
);
}