Skip to content

Commit

Permalink
fix: Popover fix the problem that popover.menu does not show when d…
Browse files Browse the repository at this point in the history
…efaultVisible=true
  • Loading branch information
TinaPeach committed Sep 5, 2023
1 parent 30390f3 commit b9c7397
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/arcodesign/components/popover/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import React, {
useMemo,
useState,
useRef,
useEffect,
forwardRef,
useImperativeHandle,
Ref,
} from 'react';
import { GlobalContext } from '../context-provider';
import { PopoverMenuItem, PopoverMenuProps, PopoverProps, PopoverRef } from './type';
import { useUpdateEffect } from '../_helpers';

export function componentGenerator<
P extends PopoverProps = PopoverProps,
Expand Down Expand Up @@ -49,8 +49,7 @@ export function componentGenerator<
const [visibleState, setVisibleState] = useState(
visible === void 0 ? defaultVisible : visible,
);

useEffect(() => {
useUpdateEffect(() => {
setVisibleState(Boolean(visible));
}, [visible]);

Expand Down

0 comments on commit b9c7397

Please sign in to comment.