I have a wrapper React component which returns a DatePicker:
import React from 'react';
import DatePicker from 'react-datepicker';
import moment from 'moment';
export default class MyDatePicker extends React.Component {
constructor (props) {
super(props)
this.state = {
startDate: moment()
};
}
handleChange(date) {
this.setState({
startDate: date
});
}
render() {
return <DatePicker
selected={this.state.startDate}
onChange={this.handleChange.bind(this)}
/>;
}
}
Eventually it will be more complex, but for right now it just returns the DatePicker. The problem is that when I try to use this component, a pre-filled date field is displayed as expected, but when I click in the field the calendar popover does not open. What do I need to do to get the calendar popover to open? How can I troubleshoot this issue?