我正在尝试从每个对象获取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,