React-Router:Failed prop type:在路由中提供给`Route`的无效prop`组件`

时间:2016-11-10 21:55:49

标签: reactjs react-router

我不知道这里的问题是什么,并尝试了许多其他解决方案,但都无法解决。任何帮助将不胜感激以解决此错误。谢谢

"react-router": "^2.8.1"

dashboard.js(摘录)

<div className="dash-container">
  {this.props.list}
  {this.props.job}
  {this.props.children}
</div>

routes.js(摘录)

<Route path="/" component={App}>
  <IndexRoute component={Landing} />
  <Route path="dashboard" component={Dashboard}>
    <Route path="jobs" component={{ list: ListContainer }} />
    <Route path="jobs/:id" component={{ list: ListContainer, job: JobsDetails }} />
    <Route path="accounts" component={AccountsDetails} />
  </Route>
</Route>

server.js(摘录)

<MuiThemeProvider muiTheme={getMuiTheme({ userAgent: 'all' })}>
  <Provider store={createStoreWithMiddleware(reducers)}>
    <RouterContext {...renderProps} />
  </Provider>
</MuiThemeProvider>

1 个答案:

答案 0 :(得分:0)

一个组件,多个组件 s

<Route path="/" component={App}>
  <IndexRoute component={Landing} />
  <Route path="dashboard" component={Dashboard}>
    <Route path="jobs" component={ListContainer} />
    <Route path="jobs/:id" components={{ list: ListContainer, job: JobsDetails }} />
    <Route path="accounts" component={AccountsDetails} />
  </Route>
</Route>