react路由

<Index location={location}>
{

        routes.map(r => {          console.log(r)            return(              <Route
                key={r.path}
                exact
                path={r.path}
                component={r.component}
              />
            )
          }

}
<Index>
报错Uncaught Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead.

其中routes=[
{path: '/app/ui/buttons', component: () =>import('../components/buttons')},
{path: '/app/ui/icons', component: () =>import('../components/icons')}
...
]


海绵宝宝撒
浏览 655回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

React.JS