Skip to content

PropTypes show warning when passing Moment instance for date #166

@keith-kurak

Description

@keith-kurak

Issue

The documentation on the readme says that a Moment instance is an acceptable value for the date prop of DatePicker. It seems to work just fine when you pass a Moment.js instance, except that a PropTypes warning appears: "Failed PropType Invalid prop date supplied to DatePicker..

Expected Behavior

There is no PropTypes warning.

Code

constructor() {
  this.state = {
    date: new Moment(),
  }
}

render() {
  return (
    <DatePicker date={this.state.date} />
  );
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions