In this article we'll learn how to write component stories in uncontrolled and controlled mode, that properly work together with args and controls in Storybook.
Hey, I'm Sandro
I'm an experienced Frontend Developer based in Switzerland. I love coding, writing and cats 🐈
In this article we'll learn how to write component stories in uncontrolled and controlled mode, that properly work together with args and controls in Storybook.
Polymorphic React components are very common and useful, but also tricky to implement and limited in what type-safety they provide. We'll talk about the problems and see an alternative approach using an asChild prop.
Reducers are not only useful for global state management. They can also be used for local component state. And compared to plain useReducer() we can reduce boilerplate code by adapting the API of modern reducer libraries like Redux Toolkit (RTK).
In this article we'll build a styling foundation for a React application using vanilla-extract, a CSS-in-JS library. We'll create a global theme, a CSS reset, utility classes, a polymorphic box component and multi-variant components.