From da628710a4d82b95d2ec6cb72d63dd052960a1a0 Mon Sep 17 00:00:00 2001 From: p-sw <shinwoo.park@psw.kr> Date: Fri, 12 Jul 2024 01:11:56 +0900 Subject: [PATCH] feat(dialog): apply ServerSideDocumentFallback --- packages/react/components/Dialog/Component.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/react/components/Dialog/Component.tsx b/packages/react/components/Dialog/Component.tsx index f5580b4..a97e747 100644 --- a/packages/react/components/Dialog/Component.tsx +++ b/packages/react/components/Dialog/Component.tsx @@ -1,4 +1,9 @@ -import { Slot, type VariantProps, vcn } from "@pswui-lib"; +import { + ServerSideDocumentFallback, + Slot, + type VariantProps, + vcn, +} from "@pswui-lib"; import React, { type ReactNode, useState } from "react"; import ReactDOM from "react-dom"; @@ -100,8 +105,9 @@ const DialogOverlay = React.forwardRef<HTMLDivElement, DialogOverlay>( }); const { children, closeOnClick, onClick, ...otherPropsExtracted } = otherPropsCompressed; + return ( - <> + <ServerSideDocumentFallback> {ReactDOM.createPortal( <div {...otherPropsExtracted} @@ -125,7 +131,7 @@ const DialogOverlay = React.forwardRef<HTMLDivElement, DialogOverlay>( </div>, document.body, )} - </> + </ServerSideDocumentFallback> ); }, );