我有MultiDayPicker
组件,如下所示:
export default class MultiDayPicker extends Component {
state = {
selectedDays: []
};
handleDayClick = (day, {selected}) => {
const { selectedDays } = this.state;
if (selected) {
const selectedIndex = selectedDays.findIndex(selectedDay =>
DateUtils.isSameDay(selectedDay, day)
);
selectedDays.splice(selectedIndex, 1);
} else {
selectedDays.push(day);
}
this.setState({ selectedDays });
};
render() {
return (
<DayPicker
selectedDays={this.state.selectedDays}
onDayClick={this.handleDayClick}
/>
);
}
}
不幸的是我收到这样的错误:
console.error node_modules\fbjs\lib\warning.js:33
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
任何可能导致此问题的想法? 提前感谢任何建议。