Glossary: React Beyond the Basics
readJson
A helper function in `api.ts` that parses a fetch response as JSON and throws an `Error` if `response.ok` is false. Query functions must throw on errors so TanStack Query can report them.
Glossary: React Beyond the Basics
A helper function in `api.ts` that parses a fetch response as JSON and throws an `Error` if `response.ok` is false. Query functions must throw on errors so TanStack Query can report them.