当我将 react-native 版本升级到 0.61.1 时显示此错误
我试图安装 Proptypes 库
<Calendar
onTouchPrev={this.onTouchPrev}
onTitlePress={this.onTitlePress}
minDate={_today}
markedDates={this.state._markedDates}
theme={{
backgroundColor: "#ffffff",
calendarBackground: "#ffffff",
textSectionTitleColor: "#b6c1cd",
selectedDayBackgroundColor: "#00adf5",
selectedDayTextColor: "#ffffff",
todayTextColor: "#00adf5",
dayTextColor: "#2d4150",
textDisabledColor: "#d9e1e8",
dotColor: "#00adf5",
selectedDotColor: "#ffffff",
arrowColor: "#00adf5",
monthTextColor: "#00adf5",
indicatorColor: "blue",
textDayFontWeight: "300",
textMonthFontWeight: "bold",
textDayHeaderFontWeight: "300",
textDayFontSize: 16,
textMonthFontSize: 16,
textDayHeaderFontSize: 16
}}
style={{ width: "98%", marginTop: 30 }}
{...this.props}
onDayPress={(
date = { day, month, year, timestamp, dateString }
) => [this.onDateChange(date, startDate)]}
/>
它会产生此错误消息:
undefined 不是对象(评估“ToolbarAndroid.propTypes”)