Skip to content

Commit

Permalink
👔 update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Jan 13, 2023
1 parent 0d029e3 commit 4b4f1d8
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
# Changelog

## [7.42.0] - 2023-01-13

## Added

- build in validation `validate` support second argument for form values

```tsx
// Making exported validate function isolated for validation
export function validateNumber(_: number, formValus: FormValues) {
return formValus.number1 + formValus.number2 === 3;
}

<input
type="number"
{...register('number1', {
validate: validateNumber,
valueAsNumber: true,
})}
/>;
```

## Changed

- `handleSubmit` no longer catch `onSubmit` callback error
- Remove deprecated for `fieldState.invalid`

## [7.41.0] - 2022-12-17

## Added

- `useForm` added `values` props

```tsx
const values = await fetch('API');

useForm({
values, // will reset the form when values updates
// resetOptions: {
// keepDirtyValues: true
// }
});
```

- new `isLoading` formState for async `defaultValues`

```tsx
const {
formState: { isLoading },
} = useForm();
```

## Changed

- `useForm` support async `defaultValues` props

```tsx
const {
formState: { isLoading },
} = useForm({
defaultValues: fetch('API'),
// resetOptions: {
// keepDirtyValues: true
// }
});
```

## [7.40.0] - 2022-11-30

## Changed
Expand Down

0 comments on commit 4b4f1d8

Please sign in to comment.