React Bits is a collection of React patterns, techniques, tips, and tricks organized as a reference guide. React is a popular JavaScript library for building user interfaces, and while it is relatively easy to start with, there are many subtle patterns and common mistakes that developers only learn through experience. This repo collects them in one place. The content is organized into several categories. Design patterns and techniques cover common solutions to recurring problems in React code, things like how to handle conditional rendering (showing different UI depending on state), the asynchronous behavior of setState() (how React batches state updates), dependency injection, one-way data flow, and the distinction between presentational components (that only display data) and container components (that manage data and logic). Anti-patterns cover common mistakes to avoid, such as storing props directly in initial state, mutating state directly, or using array indexes as keys when rendering lists. There are also sections on handling UX variations (feature flags, toggles, wrapper components), performance tips (controlling when components re-render), styling approaches, and common gotchas. This is a documentation-only repository, no code to install or run. It exists as a readable reference, also available as a formatted GitBook at vasanthk.gitbooks.io/react-bits. Community translations in Chinese and Korean are linked from the README. It is primarily useful for JavaScript developers building React applications who want a concise reference for established patterns and best practices.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.