Skip to content

Commit 608ce30

Browse files
authored
fix: align with shadow (#395)
1 parent e76b760 commit 608ce30

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"rc-align": "^4.0.0",
6767
"rc-motion": "^2.0.0",
6868
"rc-resize-observer": "^1.3.1",
69-
"rc-util": "^5.31.1"
69+
"rc-util": "^5.33.0"
7070
},
7171
"peerDependencies": {
7272
"react": ">=16.9.0",

src/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,11 @@ export function generateTrigger(
336336

337337
// ========================== Motion ============================
338338
const [inMotion, setInMotion] = React.useState(false);
339-
const mountRef = React.useRef(true);
340339

341-
useLayoutEffect(() => {
342-
if (!mountRef.current || mergedOpen) {
340+
useLayoutEffect((firstMount) => {
341+
if (!firstMount || mergedOpen) {
343342
setInMotion(true);
344343
}
345-
mountRef.current = true;
346344
}, [mergedOpen]);
347345

348346
const [motionPrepareResolve, setMotionPrepareResolve] =

0 commit comments

Comments
 (0)