【发布时间】:2021-12-28 03:48:52
【问题描述】:
我正在使用构造函数中的状态值调用 fetch api (getDieselRequisitionList()),如下所示。
this.focusListener = this.props.navigation.addListener('didFocus', () => {
this.setState({
diesel_data: []
})
this.getDieselRequisitionList(this.state.selectedStatus, this.state.selectedYear, this.state.Month[this.state.selectedMonthIndex].id)
});
我有 3 个下拉菜单。我想在 RNPickerSelect onvaluechange 上自动调用 getDieselRequisitionList 而无需在 onvaluechange 中调用函数
谢谢...
【问题讨论】:
标签: reactjs react-native fetch fetch-api