Skip to content

Commit e7ee210

Browse files
committed
feat(CPopover): make visible property reactive.
1 parent 10a1aad commit e7ee210

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/coreui-react/src/components/popover/CPopover.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { usePopper } from 'react-popper'
77
import { Transition } from 'react-transition-group'
88

99
import { Triggers, triggerPropType } from '../Types'
10+
import { useEffect } from 'react'
1011

1112
export interface CPopoverProps {
1213
// TODO: find solution to not use any
@@ -78,6 +79,10 @@ export const CPopover: FC<CPopoverProps> = ({
7879
placement: placement,
7980
})
8081

82+
useEffect(() => {
83+
setVisible(visible)
84+
}, [visible])
85+
8186
const getTransitionClass = (state: string) => {
8287
return state === 'entering'
8388
? 'fade'

0 commit comments

Comments
 (0)