Skip to content

Commit

Permalink
fix(form): DrawerForm ssr 错误 : window is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
edram committed Mar 21, 2024
1 parent c5f891a commit f31fc4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/form/src/layouts/DrawerForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
isBrowser,
omitUndefined,
openVisibleCompatible,
useRefFunction,
Expand Down Expand Up @@ -112,7 +113,7 @@ function DrawerForm<T = Record<string, any>, U = Record<string, any>>({
const resizeInfo: CustomizeResizeType = React.useMemo(() => {
const defaultResize: CustomizeResizeType = {
onResize: () => {},
maxWidth: window.innerWidth * 0.8,
maxWidth: isBrowser() ? window.innerWidth * 0.8 : undefined,
minWidth: 300,
};
if (typeof resize === 'boolean') {
Expand Down

0 comments on commit f31fc4b

Please sign in to comment.