Frontend Runtime
/
Typed React Hooks
Typed React Hooks
The generated TanStack Query hooks — fully typed, one set per model.
The generator emits one hook set per model from the OpenAPI contract. Every hook is fully typed against the resource's fields, and every query key is derived so caching and invalidation just work.
9
// List with typed filters and the DRF-shaped envelope.
10
const
{
data
,
isLoading
}
=
useListAirports
({
country
:
"JP"
});
11
data
?.
results
.
forEach
((
a
)
=>
a
.
code
/* string */
);
14
const
{
data
:
airport
}
=
useAirport
(
id
);
16
// Mutate — optimistic, with automatic cache invalidation.
17
const
create
=
useCreateAirport
();
18
create
.
mutate
({
code
:
"HND"
,
name
:
"Haneda"
});
List endpoints return a Django-REST-Framework-shaped envelope, so pagination is consistent across every model:
The hooks are thin, typed wrappers over TanStack Query, so you get caching, background refetching, and mutation lifecycles for free. What is unusual is that the same hooks run against three completely different backends without changing a line — the provider decides which. Build with AI
Every page is available as clean Markdown for LLMs and coding agents. Point one at the files below to build on top of React API Stack.
React API Stack · alpha · built to scale to millions