Skip to content

Commit

Permalink
Fix data type in FieldTemplateProps['onChange'] (#3873)
Browse files Browse the repository at this point in the history
* fix: data type in `FieldTemplateProps['onChange']`

* Add the `FieldTemplateProps['onChange']` fix to CHANGELOG

* Pass all generics from `FieldTemplateProps` down to `FieldProps['onChange']`

Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>

* Append `FieldTemplateProps['onChange']` fix to the 5.13.1 changeset

* remove extraneous empty line

---------

Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
  • Loading branch information
aularon and nickgros authored Oct 5, 2023
1 parent e487116 commit 393826e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ should change the heading of the (upcoming) version to include a major version b

- Added `getOptionMatchingSimpleDiscriminator()` function
- `getMatchingOption` and `getClosestMatchingOption` now bypass `validator.isValid()` calls when simple discriminator is provided, fixing [#3692](https://github.com/rjsf-team/react-jsonschema-form/issues/3692)
- Fix data type in `FieldTemplateProps['onChange']`


# 5.13.0
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export type FieldTemplateProps<T = any, S extends StrictRJSFSchema = RJSFSchema,
/** The formData for this field */
formData?: T;
/** The value change event handler; Can be called with a new value to change the value for this field */
onChange: FieldProps['onChange'];
onChange: FieldProps<T, S, F>['onChange'];
/** The key change event handler; Called when the key associated with a field is changed for an additionalProperty */
onKeyChange: (value: string) => () => void;
/** The property drop/removal event handler; Called when a field is removed in an additionalProperty context */
Expand Down

0 comments on commit 393826e

Please sign in to comment.