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

Improved typing for the ability to convert types when using parse/format #935

Merged
merged 2 commits into from
Sep 25, 2021

Conversation

mrfratello
Copy link
Contributor

Sometimes it is required that in FieldState.value and input.value were of different types. This is possible through the use of the parse/format props in Field or in useField config.

But when using typescript type conversion is not performed. input.value is always typed as the value from FieldState

This pull request corrects the current typing.

Closes #929

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 85ca458:

Sandbox Source
Strongly Typed Form Values with 🏁 React Final Form (forked) Issue #929

@erikras erikras merged commit 43587ba into final-form:main Sep 25, 2021
@erikras
Copy link
Member

erikras commented Sep 29, 2021

Published in v6.5.4.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong TS typing of input.value when using parseValue/formatValue that convert types
2 participants