Skip to content

Commit 640e5b2

Browse files
committed
Revert "fix: trigger should not render portal in ssr"
This reverts commit 26b9378.
1 parent ff7fd95 commit 640e5b2

File tree

4 files changed

+3
-60
lines changed

4 files changed

+3
-60
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"@testing-library/react": "^13.0.0",
4646
"@types/classnames": "^2.2.10",
4747
"@types/jest": "^26.0.15",
48-
"@types/react": "^18.0.0",
49-
"@types/react-dom": "^18.0.0",
48+
"@types/react": "^16.8.19",
49+
"@types/react-dom": "^16.8.4",
5050
"cross-env": "^7.0.1",
5151
"dumi": "^2.1.0",
5252
"eslint": "^7.0.0",

src/Popup/ServerPortal.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Popup/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import type { CSSMotionProps } from 'rc-motion';
33
import CSSMotion from 'rc-motion';
44
import ResizeObserver from 'rc-resize-observer';
55
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
6-
import canUseDom from 'rc-util/lib/Dom/canUseDom';
76
import * as React from 'react';
87
import type { TriggerProps } from '../';
98
import type { AlignType } from '../interface';
109
import Arrow from './Arrow';
1110
import Mask from './Mask';
12-
import ServerPortal from './ServerPortal';
1311

1412
export interface PopupProps {
1513
prefixCls: string;
@@ -95,7 +93,7 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
9593
forceRender,
9694
getPopupContainer,
9795
autoDestroy,
98-
portal,
96+
portal: Portal,
9997

10098
zIndex,
10199

@@ -168,8 +166,6 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
168166
miscStyle.pointerEvents = 'none';
169167
}
170168

171-
const Portal = canUseDom() ? portal: ServerPortal;
172-
173169
return (
174170
<Portal
175171
open={forceRender || isNodeVisible}

tests/ssr.test.tsx

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)