对日期对象进行prop验证
StafanNearPro
2020-03-11
目前验证Date反应道具的首选方式是什么?
Date
现在我正在使用: React.PropTypes.object
React.PropTypes.object
但是,这现在使禁止道具类型棉绒规则失效。我应该使用shape还是有更好的方法?
shape
第608篇《对日期对象进行prop验证》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
十分确定您可以使用 PropTypes.instanceOf(Date)
PropTypes.instanceOf(Date)
相似问题
0 回答
5 回答
25 回答
问题类别
十分确定您可以使用
PropTypes.instanceOf(Date)