diff --git a/packages/design/src/Form/components/Repeater/index.tsx b/packages/design/src/Form/components/Repeater/index.tsx index 86e42385..b02f14a3 100644 --- a/packages/design/src/Form/components/Repeater/index.tsx +++ b/packages/design/src/Form/components/Repeater/index.tsx @@ -1,10 +1,13 @@ import React from 'react'; -import { useFieldArray } from 'react-hook-form'; +import { useFieldArray, useForm } from 'react-hook-form'; import { type RepeaterProps } from '@atj/forms'; import { type PatternComponent } from '../../index.js'; const Repeater: PatternComponent = props => { + const { control } = useForm(); + const { fields, append, remove } = useFieldArray({ + control, name: 'fields', });