其他分享
首页 > 其他分享> > reac报错处理

reac报错处理

作者:互联网

You should not use <Route component> and <Route children> in the same route, <Route component> will be ignored.

现象:页面无法渲染

      <Router history={history}>
        <Switch>
          <Route path="/" component={layout} >
            <Route path="home" component={home} />
            <Route path="content" component={content} />
          </Route>
        </Switch>
      </Router>

原因:react-router 4.0 以上报此警告

<Layout>
    <Route path="/home" component={home} />
    <Route path="/content" component={content} />
</Layout>

标签:ignored,use,4.0,处理,报此,reac,react,报错
来源: https://www.cnblogs.com/lhx9527/p/14636534.html