David Weldon David Weldon - 1 year ago 159
React JSX Question

React prop validation for date objects

What is the currently preferred way to validate a

prop in react?

Right now I'm using:

This, however, is now failing the forbid-prop-types lint rule. Should I use a
or is there some better way?

Answer Source

Pretty sure you could use React.PropTypes.instanceOf(Date)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download