Preact
Fast 3KB React alternative with the same modern API. Full React compatibility via preact/compat shim that makes existing React code run on Preact without changes. Ships with Signals — fine-grained reactive state that bypasses virtual DOM diffing for better performance. Used by Google, Etsy, and others for performance-critical web applications. Ideal when React's ~40KB bundle size is a concern.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Client-side rendering library. Same XSS prevention model as React (JSX auto-escaping). MIT licensed and open source. No telemetry or data collection.
⚡ Reliability
Best When
Bundle size is critical (widgets, embeds, performance-sensitive landing pages) and you need a React-compatible API at a fraction of the size.
Avoid When
Your React dependencies use React internals not covered by preact/compat — test compatibility before migrating production applications.
Use Cases
- • Replace React with a 3KB alternative in bundle-size-critical applications (marketing pages, widgets, embeds) where React's size is unacceptable
- • Use preact/compat to run existing React code on Preact with minimal changes — aliased imports provide compatibility layer
- • Build high-performance components using Preact Signals for reactive state that updates DOM without virtual DOM re-diffing
- • Build Preact Island architectures for partially hydrated static sites where only interactive islands use JavaScript
- • Embed interactive components in non-SPA pages (e-commerce PDPs, landing pages) where small JS bundle size matters most
Not For
- • Large applications with extensive React ecosystem dependencies — some packages assume React internals not exposed in Preact/compat
- • Teams new to the React ecosystem — Preact is an optimization; start with React and migrate if bundle size becomes a problem
- • Applications using React Native — Preact is web-only; React Native requires React
Interface
Authentication
No authentication — UI rendering library.
Pricing
MIT licensed. Completely free. Community-maintained with backing from multiple companies.
Agent Metadata
Known Gotchas
- ⚠ preact/compat provides React compatibility but not 100% API parity — some packages using React internals (forwardRef with older patterns, unstable APIs) may not work
- ⚠ Preact Signals is not the same as React state — useState/useReducer and signals have different update semantics; mixing them requires care
- ⚠ React DevTools browser extension doesn't work with Preact — use Preact DevTools extension for debugging
- ⚠ JSX pragma must be set to h or use Preact's new JSX transform — wrong pragma causes 'h is not defined' errors
- ⚠ preact/compat alias must be configured in bundler (webpack/vite) for React packages to transparently use Preact — missing alias means shipping both
- ⚠ Preact's virtual DOM differs from React's in edge cases (key handling, event delegation) — thorough testing required when migrating
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for Preact.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.