Typescript: how to call json() method on result of promise when result could be of type Response or void?
In my React Native app I make an API call and then try to apply the json() method to the result, like this: await fetch(…) .catch(e => {…}) .then(res => res.json().then(…) Typescript throws a warning on json() saying Property ‘json’ does not exist on type ‘void | Response’. What I Want To Know: Is there… Read More Typescript: how to call json() method on result of promise when result could be of type Response or void?