首页 > 解决方案 > 这个状态管理可以在react上做吗?

问题描述

代码在这里

我想知道这样对吗?谢谢!

标签: javascriptreactjsreduxjsxantd

解决方案


首先,请在问题中发布您的代码并清楚地描述

使用 getLabels 函数,您应该在构造函数中绑定(this)或使用箭头函数,然后您可以在 getLabels 函数中使用 this.setState。前任:

constructor(props){
  super(props)
 this.getLabels = this.getLabels.bind(this)
}

或者:getLabels = () => {}


推荐阅读