Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data type in FieldTemplateProps['onChange'] #3873

Merged
merged 6 commits into from
Oct 5, 2023

Conversation

aularon
Copy link
Contributor

@aularon aularon commented Sep 19, 2023

Reasons for making this change

Typing is not passed on, so even if we have a type (<T>) on FieldTemplateProps, its onChange method is typed to have any as first argument, which is incorrect. This fixes it.

Checklist

  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR

…ange']`

Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
@heath-freenome
Copy link
Member

@aularon Good catch! Thanks for the fix. Can you resolve the conflict in CHANGELOG.md and I'll approve and merge

@aularon
Copy link
Contributor Author

aularon commented Oct 5, 2023

@aularon Good catch! Thanks for the fix. Can you resolve the conflict in CHANGELOG.md and I'll approve and merge

@heath-freenome Done. Happy to help! Thank you 🙏

CHANGELOG.md Outdated
Comment on lines 18 to 22

## @rjsf/utils
- Fix data type in `FieldTemplateProps['onChange']`


Copy link
Member

@heath-freenome heath-freenome Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just move this down under the @rjsf/utils below in 5.13.1 since it has yet to be published... I.e.:

# 5.13.1

## @rjsf/utils
- 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']`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it was already published! Fixed now.

@heath-freenome heath-freenome merged commit 393826e into rjsf-team:main Oct 5, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants