react-native - 函数运行中的事件发射器回调
问题描述
我正在使用 EventEmitter 触发一个事件,但我无法运行我在此事件中使用的类中的方法。我在哪里做错了,我该如何解决这个问题?
StaticBase.emitter.addListener('event', this._updateEvent);
_updateEvent(value) {
if (value.length > 3) {
this.setState({ keys: value });//---->ERROR function not found, etc .. errors
this.UpdateList();
}
}
UpdateList() {
this.setState({ isLoading: true });
console.log('POST------>>');
axios.post('.........')
.then(response => {
this.setState({ newlist: response.data });
this.setState({ isLoading: false });
}).catch(ex => {
console.log(ex);
this.setState({ isLoading: false });
});
}
解决方案
推荐阅读
- java - json 模式不适用于 type = number 和 pattern = 10 digit 常规模式
- algorithm - 具有并行性的排列奇偶性
- database - 将数据插入 Atlas MongoDB 出现错误:文档包含错误时不允许插入
- java - jOOQ - 具有多对多关系的嵌套对象
- r - 使用 RcppArmadillo 对矩阵进行非连续子集化
- javascript - useEffect 提交表单时的副作用
- javascript - 如何使用 Expect: 100-continue 标头处理客户端 POST 正文请求流?
- xamarin.forms - 改装我在初始化时显示错误
- javascript - Pusher Beam 停止私人通知但保留公共通知
- vue.js - 如何在 Bootstrap-vue 表的单元格中创建图表?