definition is correct in this fetch response handler:
const handleResponse = (res: Response) : Promise<Error> => (res.ok ? res.json() : Promise.reject(`Error: ${res.status}`));
So the strictest and MOST correct type for this would be: (res: Response): Promise<unknown>
Обсуждают сегодня