Skip to content

Commit

Permalink
🥼 update changelog for 7.35.0 and 7.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Sep 26, 2022
1 parent 5d2fe37 commit 01df1e2
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# Changelog

## [7.36.0] - 2022-9-20

## Added

- reset to support callback syntax

```tsx
reset((formValues) => {
return {
...formValues,
partialData: 'onlyChangeThis',
};
});
```

## [7.35.0] - 2022-9-10

## Added

- new type `FieldPathByValue` field path by value generic implementation

```tsx
function CustomFormComponent<
TFieldValues extends FieldValues,
Path extends FieldPathByValue<TFieldValues, Date>,
>({ control, name }: { control: Control<FieldValues>; name: Path }) {
const { field } = useController({
control,
name,
});
}

function App() {
const { control } = useForm<{
foo: Date;
baz: string;
}>();

return (
<form>
<CustomFormComponent control={control} name="foo" /> {/* no error */}
<CustomFormComponent control={control} name="baz" /> {/* throw an error since baz is string */}
</form>
);
}
```

## Changed

- form context support children prop type

```tsx
<FormProvider {...methods}>
<div /> // ✅
<div /> // ✅
</FormProvider>
```

## [7.34.0] - 2022-7-28

## Added
Expand Down

0 comments on commit 01df1e2

Please sign in to comment.