简体   繁体   English

React-Router:失败的prop类型:在route中提供给Route的无效prop`component`

[英]React-Router: Failed prop type: Invalid prop `component` supplied to `Route` in route

I have no idea what the issue is here and have tried many other solutions but none work. 我不知道这里是什么问题,并且尝试了许多其他解决方案,但没有任何效果。 Any help would be appreciated to fix this error. 任何帮助将不胜感激以解决此错误。 Thank you 谢谢

"react-router": "^2.8.1"

dashboard.js (excerpt) dashboard.js(节选)

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

routes.js (excerpt) route.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 (excerpt) server.js(节选)

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

One component, multiple component s : 单组分,多组分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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告:道具类型失败:提供给“路线”的道具属性无效。 &警告:[反应路由器]位置“ /”与任何路线均不匹配 - Warning: Failed prop type: Invalid prop `component` supplied to `Route`. & Warning: [react-router] Location “/” did not match any routes 反应路由器,多个组件警告:道具类型失败:提供给“路线”的道具“组件”无效 - react router, multiple components warning: Failed prop type: Invalid prop `component` supplied to `Route` 警告:失败的道具类型:提供给“路由”的无效道具“组件”-react-router-dom - Warning: Failed prop type: Invalid prop 'component' supplied to 'Route' - react-router-dom 警告:道具类型失败:提供给“路由”的道具“组件”无效:道具不是路由中的有效 React 组件 - Warning: Failed prop type: Invalid prop 'component' supplied to 'Route': the prop is not a valid React component in Route 警告:道具类型失败:提供给“路线”的道具属性无效。 在途中 - Warning: Failed prop type: Invalid prop `component` supplied to `Route`. in Route 警告:失败的道具类型:提供给“路由”的“对象”类型的无效道具“组件”,预期的“函数”使用 react-router-dom 错误 - Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function` Error using react-router-dom 反应路由器错误:无效的道具组件提供给路线 - React Router Error: Invalid prop `component` supplied to `Route` 带有React 16.6 Suspense的React Router“向“ Route”提供了类型为“ object”的无效prop`component`,预期为“ function”。” - React Router with React 16.6 Suspense “Invalid prop `component` of type `object` supplied to `Route`, expected `function`.” 警告:道具类型失败:提供给“Route”的“object”类型的无效道具“component”,预期为“function” - Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function` 道具类型失败:提供给“Route”的“object”类型的无效道具“component”,预期为“function” - Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM