0

当我将 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”)

4

1 回答 1

1

作为精益核心工作的一部分,React Native 已经ToolbarAndroidv61(甚至可能,如果我从早期尝试将它集成到这个版本中没记错的话)移除。v60但是,截至今天,该文档仍可在主站点上找到。我想这将很快被删除。看到这个Github 问题

也没有(还可能)一个@react-native-community版本。因此,您可能需要推出自己的产品或使用JS变体

于 2019-10-05T08:07:12.560 回答