Skip to content

Commit

Permalink
re-add useform hook. needed for pattern validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethangardner committed Dec 5, 2024
1 parent e959ed3 commit 317b750
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/design/src/Form/components/Repeater/index.tsx
Original file line number Diff line number Diff line change
@@ -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<RepeaterProps> = props => {
const { control } = useForm();

const { fields, append, remove } = useFieldArray({
control,
name: 'fields',
});

Expand Down

0 comments on commit 317b750

Please sign in to comment.