Skip to content
New issue

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

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

Already on GitHub? # to your account

Do not pass undefined type to input #548

Merged
merged 1 commit into from
Jul 6, 2019

Conversation

ThiefMaster
Copy link
Contributor

Some custom widgets (such as the SingleDatePicker in react-dates) have very strict prop types, that reject unknown props. So even type={undefined} will fail the prop type check.

With this PR type is only included in input, if it's not undefined.

@codecov
Copy link

codecov bot commented Jun 24, 2019

Codecov Report

Merging #548 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #548   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          16     16           
  Lines         228    230    +2     
  Branches       56     57    +1     
=====================================
+ Hits          228    230    +2
Impacted Files Coverage Δ
src/useField.js 100% <100%> (ø) ⬆️

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 8674fc7...c01469b. Read the comment docs.

@erikras
Copy link
Member

erikras commented Jul 6, 2019

OH! It took me a minute to figure out what this was doing. Nice PR. 👍

Talk about an edge case! 😄

@erikras erikras merged commit f3e7c17 into final-form:master Jul 6, 2019
@ThiefMaster ThiefMaster deleted the dont-pass-undefined-type branch July 6, 2019 23:11
@lock
Copy link

lock bot commented Aug 6, 2019

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 Aug 6, 2019
@erikras
Copy link
Member

erikras commented Nov 18, 2019

Published in v6.3.1.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants