I have a React Native API call I am making.
Theoretically it should work -
import API from "../../utils/API";
componentDidMount() {
let merchantId = this.props.merchant.id;
let api = new API(this.props.gatheredTokens);
let self = this;
api.setRetry(10);
api
.get("merchantMessages", { repl_str: merchantId })
.then(response => this.merchantMessageConfiguration(response.data))
.catch(function (error) {
console.log(error);
})
.finally(function () {
self.state.list.push(
<Card
merchant={self.props.merchant}
key={self.props.merchant.id}
bubblemsg={self.state.bubblemsg}
/>
);
})
.finally(function () {
self.merchantNoticeLoading(self);
});
}
However I am getting the following error:
What is causing this error? The code looks valid.
Here is what get is:
get(API, params = this.defaultParams) {
this.call = "GET";
let constructedURL = this.constructURL(API, params);
axiosRetry(axios, { retries: this.retry });
return axios.get(constructedURL, this.config);
}