有人可以分享一下为什么此路由器配置在尝试访问to/design/project/whatever
时不想渲染Project
组件吗?
<Route path="/" component={MainWrapper}>
<Route path="to/design/" component={Design}>
<Route path="project/:id" component={Project} />
</Route>
<Route path="to/code" component={Code} />
</Route>
感谢您的宝贵时间!
最佳答案
我只是忘记在 Design
组件中指定 {this.props.children}
。
关于javascript - React 嵌套路由不渲染组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36138130/