我正试图得到
dots
每个对象的数组。然而,我不断得到无法读取属性点的未定义。
let events = fetchEvents[this.state.selectedDay || selected];
在我的组件中,我使用:
<EventCalendar
events={events.dots || []}
...
我是我的
EventCalendar
组件,
this.props.events
是
undefined
render() {
const {
width,
virtualizedListProps,
initDate,
formatHeader,
upperCaseHeader = false
} = this.props;
const allDayEvents = this.props.events.filter(
event => event.allDayEvent == 1
);
fetchEvents
数组:
2019-03-06: {dots: Array(2), disabled: false, selected: true, selectedColor: "#00CCCB", customStyles: {â¦}}
2019-03-07: {dots: Array(1), disabled: false, selected: true,