From bfa5afd832d6bf89dca5a7aa82d9cb6d289d8ca2 Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Sun, 20 Aug 2023 22:05:39 +0200 Subject: [PATCH] chore: minor refactor #2025 --- ui/src/copyable_text.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/src/copyable_text.tsx b/ui/src/copyable_text.tsx index ec45b189cb..1cf5058202 100644 --- a/ui/src/copyable_text.tsx +++ b/ui/src/copyable_text.tsx @@ -105,12 +105,7 @@ export const ClipboardCopyButton = ({ value, anchorElement, showOnHoverOnly = fa React.useEffect(() => { if (!anchorElement) return - if (portal) { - ReactDOM.render( - ReactDOM.createPortal(CopyButton, anchorElement), - btnContainerRef.current - ) - } + if (portal) ReactDOM.render(ReactDOM.createPortal(CopyButton, anchorElement), btnContainerRef.current) if (showOnHoverOnly) anchorElement.classList.add(css.hover) }, [CopyButton, anchorElement, portal, showOnHoverOnly])