-
Book Overview & Buying
-
Table Of Contents
React Application Architecture for Production - Second Edition
By :
In this chapter, we built the foundation for our application's user interface.
We started by understanding what components are – self-contained pieces of UI that use props for input, state for managing values, event handlers for interactions, and TypeScript for type safety.
Next, we evaluated different approaches to component libraries. We chose Shadcn UI because it gives us full control by copying components directly into our code base, while still benefiting from Base UI for accessibility and Tailwind CSS for styling. We can use the Shadcn CLI to add components, or we can copy the code manually.
Finally, we set up Storybook for component documentation. We configured Storybook to work with React Router and Vite, created story files that showcase different component states, and learned how Storybook provides an isolated environment for developing and testing components. This gives us a living catalog that designers, developers, and stakeholders can reference.
With...