javascript – Error with componentDid mount when setting value from api call response

I have a disableButton: boolean; and want to set it’s value based on the response from this GET: async getDocStatus(policy: string): Promise<boolean> { return await ApiService.getData(this.apiUrl + policy + this.myEndpoint).then( (response) => response.data ); } I’d like this to be done when my page loads so have added the call to my componentDidMount: componentDidMount() { … Read more