DEV Community

All In Developer
All In Developer

Posted on Edited on Originally published at all1n.dev

πŸ’ͺ🏼 Typed fetch Response in TypeScript

fetch is great until you call response.json() in TypeScript and get any back, throwing away your types right at the API boundary. There’s a small, reusable way to get a properly typed response without casting at every call site.


πŸ‘‰ Continue reading on my blog: πŸ’ͺ🏼 Typed fetch Response in TypeScript

Top comments (0)