Closed edram closed 1 month ago
在 nextjs 使用 @ant-design/pro-form 中的 DrawerForm 组件 ,会提示 ⨯ ReferenceError: window is not defined
见 bug 描述
服务端渲染不报错
codesandbox
这行代码会导致 ssr 报错
https://github.com/ant-design/pro-components/blob/0dede4fd9db4cdc02f5c3ff2119f3a449414be31/packages/form/src/layouts/DrawerForm/index.tsx#L115
🐛 bug 描述
在 nextjs 使用 @ant-design/pro-form 中的 DrawerForm 组件 ,会提示 ⨯ ReferenceError: window is not defined
📷 复现步骤
见 bug 描述
🏞 期望结果
服务端渲染不报错
💻 复现代码
codesandbox
© 版本信息
🚑 其他信息
这行代码会导致 ssr 报错
https://github.com/ant-design/pro-components/blob/0dede4fd9db4cdc02f5c3ff2119f3a449414be31/packages/form/src/layouts/DrawerForm/index.tsx#L115