-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89c40b7
commit b0f2624
Showing
2 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
'@kurrent-ui/fields': minor | ||
--- | ||
|
||
`FieldChangeEvent` is now more flexible. | ||
|
||
Previously, it only took the complete form type, and a key to the form: | ||
|
||
```ts | ||
interface MyForm { | ||
something: number; | ||
another: string; | ||
} | ||
|
||
const handleSomethingChange = (e: FieldChangeEvent<MyForm, 'something'>) => { | ||
// e.details is now `{ name: "something", value: number }` | ||
}; | ||
``` | ||
|
||
Now, you can also pass a typing as a single value, so it is easier to use outside of a validatedForm context: | ||
|
||
```ts | ||
const handleSomethingChange = (e: FieldChangeEvent<number>) => { | ||
// e.details is now `{ name: string, value: number }` | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters