I am trying to retrieve the data from fetch and pass it back within this function in order to return the information to the original call made to this class and function. Unfortunately, I encountered this error message:
Type 'Promise<any>' is missing the following properties from type 'String[]': length, pop, push, concat, and 28 more.
export default class GetApiData {
static getThemeParkData(): Array<String> {
return fetch(
url,
{
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
}
}
)
.then((response) => {
return response.json()
})
}
}