Skip to content

Commit

Permalink
fix(Overlay): 修复Overlay 始终拿不到node (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuilanxin authored Apr 12, 2022
1 parent c9625d8 commit 15d151f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions packages/react-overlay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default function Overlay(props: OverlayProps) {
onClosing = noop,
onClosed = noop,
onClose = noop,
onEnter = noop,
children,
dialogProps = {},
...otherProps
Expand Down Expand Up @@ -134,10 +135,21 @@ export default function Overlay(props: OverlayProps) {
unmountOnExit={unmountOnExit}
timeout={timeout!}
in={isOpen}
onEntering={onOpening}
onEntered={onOpened}
onExiting={onClosing}
onExited={handleClosed}
onEnter={(_, isAppearing) => {
onEnter(overlay.current!, isAppearing);
}}
onEntering={(_, isAppearing) => {
onOpening(overlay.current!, isAppearing);
}}
onEntered={(_, isAppearing) => {
onOpened(overlay.current!, isAppearing);
}}
onExiting={() => {
onClosing(overlay.current!);
}}
onExited={() => {
handleClosed(overlay.current!);
}}
nodeRef={overlay}
{...otherProps}
>
Expand Down

0 comments on commit 15d151f

Please sign in to comment.