Preact Explained: React, But 3 Kilobytes
Introduction React (covered earlier) is the default UI library — and, at around 40KB compressed plus its ecosystem, a heavy one for widgets, embeds, and performance-critical pages. Preact, released in 2015, asks a simple question: what if you kept React's API and dropped the weight? At about 3KB, Preact implements the same component model, hooks, and JSX, and most React code runs on it unchanged through a compatibility layer. It is the framework for places where every kilobyte counts. The same API, a fraction of the size Preact's compatibility is deliberate: Same API — components, hooks ( useState , useEffect ), and JSX work as in React; preact/compat adds the remaining React APIs (like React.memo and synthetic events) for libraries that expect them. Tiny core — 3KB means Preact loads fast on slow networks and embeds well in pages that are not primarily React apps: widgets, ads, and progressive enhancement. Signals option — Preact Signals (like Solid's, batch 28) o...