Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebill1049 committed Jun 22, 2023
2 parents 4f8f522 + a4be81f commit 5a1c479
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
# Changelog

## [7.45.0] - 2023-06-20

## Changed

- Controller with type check on `onChange`

```diff
- onChange: (...event: any[]) => void;
+ onChange: (event: ChangeEvent | FieldPathValue<TFieldValues, TName>) => void;
```

- include missingg geneirc for useFormContext

```diff
- export const useFormContext: <TFieldValues extends FieldValues, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues>;
+ export const useFormContext: <TFieldValues extends FieldValues, TContext = any, TransformedValues extends FieldValues | undefined = undefined>() => UseFormReturn<TFieldValues, TContext, TransformedValues>;
```

## [7.44.0] - 2023-06-14

## Added

- New `<Form />` component

```tsx
// Send post request with formData
<Form
action="/api"
control={control}
onSuccess={() => {
alert("Great");
}}
/>

// Send post request with json form data
<Form action="/api" encType="application/json" headers={{ accessToken: 'test' }}>
{errors.root?.server.type === 500 && 'Error message'}
{errors.root?.server.type === 400 && 'Error message'}
</Form>

// Send post request with formData with fetch
<Form
onSubmit={async ({ formData, data, formDataJson, event }) => {
await fetch("api", {
method: "post",
body: formData,
});
}}
/>
```

- support `TransformedValues` with `useFormContext`

`useFormContext<FormValue, TransformedValues>()`

- added `TTransformedValues` to `FormProvider`

FormProviderProps<TFieldValues, TContext, TTransformedValues>

## [7.43.0] - 2023-01-30

## Added
Expand Down

0 comments on commit 5a1c479

Please sign in to comment.