ReactNative 使用axios请求数据后在其内部调用this.setState({})刷新UI时报 [TypeError: undefined is not a function]解决方法!

使用axios请求数据后在其内部调用this.setState({})刷新UI时报[TypeError: undefined is not a function]

使用下面这个方法:

axios({
      method: "get",
      url: url,
    })
      .then((response) => {
        let data = response.data;
        let dic = data["object"];
        this.setState({}); 
      })
      .catch(function(error) {
        console.log(error);
      });

你可能感兴趣的:(ReactNative 使用axios请求数据后在其内部调用this.setState({})刷新UI时报 [TypeError: undefined is not a function]解决方法!)