CalebMorris / react-moment-proptypes

React proptype validator for moment.js
49 stars 17 forks source link

Optional prop types should allow null #10

Closed rjbailey closed 8 years ago

rjbailey commented 8 years ago

The default behavior of React's optional prop types is to allow null or undefined. Right now moment-proptypes only allows undefined when a prop is not required. It would be great if moment-proptypes' behavior was consistent with React's!

CalebMorris commented 8 years ago

@rjbailey Merged PR to fix this (and some updates to the React renderer for tests) and updated npm package to v1.1.0. Let me know if you run into any problems as I did very little tests (and ran into some oddities that should have been caused by an ancient version of react I had). Thanks for the assistance in keeping this package to spec.