Skip to content

Commit d5d2b84

Browse files
Copilothuangyiirene
andcommitted
Fix useEffect dependency array and simplify UUID generation
Co-authored-by: huangyiirene <7665279+huangyiirene@users.noreply.github.com>
1 parent 4f7b1a1 commit d5d2b84

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/components/src/ui/filter-builder.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function FilterBuilder({
7777
if (value && JSON.stringify(value) !== JSON.stringify(filterGroup)) {
7878
setFilterGroup(value)
7979
}
80-
}, [value])
80+
}, [value, filterGroup])
8181

8282
const handleChange = (newGroup: FilterGroup) => {
8383
setFilterGroup(newGroup)
@@ -86,7 +86,7 @@ function FilterBuilder({
8686

8787
const addCondition = () => {
8888
const newCondition: FilterCondition = {
89-
id: `condition-${crypto.randomUUID()}`,
89+
id: crypto.randomUUID(),
9090
field: fields[0]?.value || "",
9191
operator: "equals",
9292
value: "",

0 commit comments

Comments
 (0)