我通过 npm install flatpickr 安装了 flatpickr。日历显示就像单击输入控件时一样
var React = require('React');
var ReactDOM = require('ReactDOM');
var Flatpickr = require('flatpickr');
var Calender = React.createClass({
componentDidMount: function(){
this.flatpickr = new Flatpickr(this.refs.date, {dateFormat: "m/d/Y"});
},
render: function() {
return(
<div>
<input data-enable-time defaultValue='2016-11-11' ref="date_from" />
</div>
);
}
});