Skip to content

Commit

Permalink
fix: FooterToolbar supports SSR (#8969)
Browse files Browse the repository at this point in the history
* fix: FooterToolbar supports SSR

* fix: SettingDrawer supports SSR

---------

Co-authored-by: dino.tan <[email protected]>
  • Loading branch information
banchichen and dino.tan authored Jan 14, 2025
1 parent 0fef87f commit 0ddf168
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/layout/src/components/FooterToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const FooterToolbar: React.FC<FooterToolbarProps> = (props) => {
}, [value.collapsed, value.hasSiderMenu, value.isMobile, value.siderWidth]);

const containerDom = useMemo(() => {
if (typeof window === undefined || typeof document === undefined)
if (typeof window === 'undefined' || typeof document === 'undefined')
return null;
// 只读取一次就行了,不然总是的渲染
return getTargetContainer?.() || document.body;
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/components/SettingDrawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const SettingDrawer: React.FC<SettingDrawerProps> = (props) => {
onSettingChange,
enableDarkTheme,
prefixCls = 'ant-pro',
pathname = window.location.pathname,
pathname = isBrowser() ? window.location.pathname : '',
disableUrlParams = true,
themeOnly,
drawerProps,
Expand Down

0 comments on commit 0ddf168

Please sign in to comment.