-
Book Overview & Buying
-
Table Of Contents
Clean Code with TypeScript
By :
With our type-safe backend in place, we are going to focus on building the frontend that consumes the API. I have opted to use React to keep things relatively straightforward, but the ideas and concepts learned here can be applied elsewhere. We are going to reuse the types we generated with Orval for our API contracts in the previous section while building.
We already used Orval to generate types for the backend. Now we'll configure it to generate React Query hooks that give us type-safe API calls with zero manual work.
app.tsx will be the root component where we'll set up routing, and main.tsx is the entry point where we'll configure React Query.
Before we proceed, let's install some frontend dependencies that we will need for our application.
Before we configure Orval, let's install the dependencies that we'll need. We're installing these now because Orval's configuration will...