0
我的路由配置是这样的:阵营路由器V4嵌套
[
{
path: '/',
exact: true,
component: Dashboard
},
{
path: '/stories/:storyId',
component: Story,
},
{
component: Dashboard,
status: 404
}
]
现在故事构件的内部我想呈现一个画廊,每一张照片都需要有自己的网址。有这样的事情:
<Switch>
<Redirect from={match.url} to={`${match.url}/1`} />
<Route path={`${match.url}/:photoId`} render={this.renderGallery } />
</Switch>
不幸的是,它进入一个无限循环,导致match.url在重定向后永不改变。
有人可以帮助我吗?谢谢
太谢谢你了! –