Skip to content

Commit b812293

Browse files
committed
Fix vanilla ArrayControl addItem function
The vanilla ArrayControl was wrapping the `addItem` in a function, whereas the `addItem` function is already wrapped. So the `onClick` can directly be bound to `addItem`. Fixes #1948
1 parent 413b976 commit b812293

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vanilla/src/complex/array/ArrayControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const ArrayControl = ({
5050
<legend>
5151
<button
5252
className={classNames.button}
53-
onClick={() => addItem(path, createDefaultValue(schema))}
53+
onClick={addItem(path, createDefaultValue(schema))}
5454
>
5555
+
5656
</button>

0 commit comments

Comments
 (0)