Skip to content

Conversation

ebramanti
Copy link
Contributor

As specified in the README, the default value for value is null, even though normally it will be of type Moment.

However, the onChange handler type is specified to always return a Moment:

onChange?: (newValue: Moment) => void;

I have updated the type to be a union type of Moment | null which properly handles the default value case returning from onChange.

Does any additional work need to be done to push these changes to @types/rc-time-picker? That is currently what I am using.

The default value that is returned to the onChange handler is null,
which is not covered in this current type definition.
@vercel
Copy link

vercel bot commented Dec 26, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/react-component/time-picker/5jrszblkq
🌍 Preview: https://time-picker-git-fork-jadengore-fix-onchange-typing.react-component.now.sh

@codecov
Copy link

codecov bot commented Dec 26, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #181   +/-   ##
=======================================
  Coverage   91.86%   91.86%           
=======================================
  Files           6        6           
  Lines         381      381           
  Branches       99       99           
=======================================
  Hits          350      350           
  Misses         31       31

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 e78a62e...12573a1. Read the comment docs.

@afc163 afc163 merged commit a3650ee into react-component:master Dec 27, 2019
@ebramanti ebramanti deleted the fix-onChange-typing branch January 2, 2020 18:34
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.

2 participants