diff --git a/packages/circuit-ui/components/SidePanel/SidePanelContext.spec.tsx b/packages/circuit-ui/components/SidePanel/SidePanelContext.spec.tsx index bca7fa74ea..4ef19948ac 100644 --- a/packages/circuit-ui/components/SidePanel/SidePanelContext.spec.tsx +++ b/packages/circuit-ui/components/SidePanel/SidePanelContext.spec.tsx @@ -58,9 +58,12 @@ vi.mock('./SidePanel.js', () => ({ onAfterClose, children, }: { open: boolean; onAfterClose?: () => void; children: ReactNode }) => { - useEffect(() => () => { + useEffect( + () => () => { onAfterClose?.(); - }, [onAfterClose]); + }, + [onAfterClose], + ); return {children}; }, diff --git a/packages/circuit-ui/components/SidePanel/components/DesktopSidePanel/DesktopSidePanel.tsx b/packages/circuit-ui/components/SidePanel/components/DesktopSidePanel/DesktopSidePanel.tsx index 930dbafcca..d3afdd3288 100644 --- a/packages/circuit-ui/components/SidePanel/components/DesktopSidePanel/DesktopSidePanel.tsx +++ b/packages/circuit-ui/components/SidePanel/components/DesktopSidePanel/DesktopSidePanel.tsx @@ -66,15 +66,6 @@ export const DesktopSidePanel = forwardRef< return () => clearTimeout(timeoutId); }, [open]); - useEffect( - () => () => { - if (dialogRef.current) { - dialogRef.current?.close(); - } - void onClose?.(); - }, - [onClose], - ); const [isOpen, setIsOpen] = useState(false); function onEscapeKey() {