Blog

Compound Components Pattern in React
Every component library eventually builds a Tabs component, and the first version usually looks like this: Tabs with an items prop that takes an
Continue Reading
Discriminated Unions for Type-Safe React Props
Look at almost any growing component library and you'll find props types like this: href?: string, onClick?: () => void, isLoading?: boolean, `
Continue Reading
Generic Components in React with TypeScript
Sooner or later you build a component that works with "some kind of item": a list, a dropdown, a table, an autocomplete. The first version usually ty
Continue Reading
TypeScript with React: Typing Props, State, and Events
Most React bugs that TypeScript catches are boring ones: a prop passed as a string instead of a number, a state value that can be null but is used
Continue Reading
Migrating from Create React App to Vite
Create React App was the default way to start a React project for years, but it's now officially deprecated. The React team stopped recommending it i
Continue Reading
Building React Apps with Vite: A Fast Modern Setup
If you've worked on an older React project, you probably remember waiting for the dev server. Starting it took half a minute, and every save took a f
Continue Reading