react路由严格模式问题

react路由严格模式问题

1.react路由

  • 设置路由的时候,子路由不能设置严格模式,不然是出现空白页面

    • exact:false

    • <LocaleProvider locale={zhCN}>
              <Layout>
                <Switch>
                  {
                    routeArr.map((item, index)=> {
                      return <Route key={index} exact={!item.children} path={item.path} component={SetInfo(item)}/>
                    })
                  }
                </Switch>
              </Layout>
            </LocaleProvider>
      

@蚵仔煎-20231017

你可能感兴趣的:(react.js,javascript,前端)