We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33acdb0 commit 0f62648Copy full SHA for 0f62648
src/components/common/SidePanel/SidePanelHeaderActions.tsx
@@ -1,9 +1,19 @@
1
-import { PropsWithChildren } from 'react'
+import { PropsWithChildren, useEffect, useState } from 'react'
2
import { createPortal } from 'react-dom'
3
4
import { logExceptionToSentry } from '@devtron-labs/devtron-fe-common-lib'
5
6
export const SidePanelHeaderActions = ({ children }: PropsWithChildren<{}>) => {
7
+ const [hasComponentRenderedOnce, setHasComponentRenderedOnce] = useState(false)
8
+
9
+ useEffect(() => {
10
+ setHasComponentRenderedOnce(true)
11
+ }, [])
12
13
+ if (!hasComponentRenderedOnce) {
14
+ return null
15
+ }
16
17
const targetElement = document.getElementById('devtron-side-panel-actions')
18
19
if (!targetElement) {
0 commit comments