The JS object is released when the local module call RCTResponseSenderBlock
XSYRequest.get(REQUEST_URL,{'source':'2','prePageLastId':'0','size':'25','start':'0'},function (response){ if (response.scode) { this.setState({ dataSource: this.state.dataSource.cloneWithRows(response.body.feeds), loaded: true, }); } });
‘XSYRequest’ is my AFNetWorking request, after the AFNetWorking asynchronous request, I would like to call this.setState, but found that ‘this’ is empty. The JS object is released when the local module is back up.
i modify the code var _this = this; XSYRequest.get(REQUEST_URL,{'source':'2','prePageLastId':'0','size':'25','start':'0'},function (response){ if (response.scode) { _this.setState({ dataSource: _this.state.dataSource.cloneWithRows(response.body.feeds), loaded: true, }); } });