Skip to content

Commit

Permalink
fix(dropdown): fix dropdown useEffect dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
masoudmanson committed Sep 21, 2023
1 parent 3959a9f commit 9618c42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/core/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ const Dropdown = <Multiple extends boolean | undefined = false>({

useEffect(() => {
onChange(value);
}, [value]);
}, [onChange, value]);

useEffect(() => {
if (isControlled) {
setValue(propValue);
}
}, [propValue]);
}, [isControlled, propValue]);

const [open, setOpen] = useState(false);

Expand Down

0 comments on commit 9618c42

Please sign in to comment.