ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.5k stars 8.14k forks source link

Login Page is not included ChildrenRender in app.ts #11128

Closed NguyenThinh-17001510 closed 9 months ago

NguyenThinh-17001510 commented 9 months ago

I just console log inside the function childrenRender in app.ts. When i redirect to My Page Login, console.log is not running. z5081495460702_6edd878443baeecc274b44ccc6b55fe1 z5081498124248_76ae216f72566c892633cb7366e0e707

chenshuai2144 commented 9 months ago

因为 login 没有被 layout 包裹,想要配置所有的的页面被包裹可以试试

https://umijs.org/docs/api/runtime-config#rootcontainerlastrootcontainer-args

export function rootContainer(container) {
  return React.createElement(ThemeProvider, null, container);
}
echoyl commented 3 months ago

因为 login 没有被 layout 包裹,想要配置所有的的页面被包裹可以试试

https://umijs.org/docs/api/runtime-config#rootcontainerlastrootcontainer-args

export function rootContainer(container) {
  return React.createElement(ThemeProvider, null, container);
}

如果使用这个方法 rootContainer 里面包含的组件中无法使用useModel('@@initialState');

TypeError: Cannot read properties of null (reading 'dispatcher')