Skip to content

Commit

Permalink
useEventCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Dec 12, 2024
1 parent 7dfd8d2 commit 57ff8d0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/dialog/root/useDialogRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@ export function useDialogRoot(parameters: useDialogRoot.Parameters): useDialogRo
onFinished: () => setMounted(false),
});

const handleFloatingUIOpenChange = React.useCallback(
const handleFloatingUIOpenChange = useEventCallback(
(
nextOpen: boolean,
event: Event | undefined,
reason: FloatingUIOpenChangeReason | undefined,
) => {
setOpen(nextOpen, event, translateOpenChangeReason(reason));
},
[setOpen],
);

const context = useFloatingRootContext({
Expand Down

0 comments on commit 57ff8d0

Please sign in to comment.