Skip to content

Commit

Permalink
fix: fix array field when used on root
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Mar 25, 2024
1 parent c1224d0 commit 95280e6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export const ArrayField = ({

// Create a mirror of value with IDs added for drag and drop
useEffect(() => {
setUi(mapArrayStateToUi(arrayState));
if (arrayState.items.length > 0) {
setUi(mapArrayStateToUi(arrayState));
}
}, []);

const [hovering, setHovering] = useState(false);
Expand Down

0 comments on commit 95280e6

Please sign in to comment.