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 type definition for Field #708

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Conversation

jankalfus
Copy link
Contributor

@jankalfus jankalfus commented Dec 27, 2019

Use Field's first generic argument in the default for second generic argument.

Here's an example (notice any vs Date):
obrazek

Since the first generic argument already defaults to any, there's no need to set any in it's place in the second generic argument. This way, if a developer only sets the first generic argument of Field, they still get the input.value prop properly typed, instead of being any (current behavior). And if they omit it all together, it'll default to any, as it currently does.

Use first generic argument in the default for second generic argument.
@codecov
Copy link

codecov bot commented Dec 27, 2019

Codecov Report

Merging #708 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #708   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          17     17           
  Lines         251    251           
  Branches       58     58           
=====================================
  Hits          251    251

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d90e418...3de3d94. Read the comment docs.

@erikras erikras merged commit 3450d7d into final-form:master Jan 21, 2020
@erikras
Copy link
Member

erikras commented Jan 22, 2020

Published in v6.3.4.

@lock
Copy link

lock bot commented Feb 21, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 21, 2020
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.

None yet

2 participants