What is Preact?
Preact is an attempt to recreate the core value proposition of React (or similar libraries like Mithril) using as little code as possible, with first-class support for ES2015. Currently the library is around 3kb (minified & gzipped).
Closer to the DOM
Preact can be used directly in the browser without any transpilation steps.
Preact is fast, and not just because of its size. It’s one of the fastest Virtual DOM libraries out there, thanks to a simple and predictable diff implementation.
We automatically batch updates and tune Preact to the extreme when it comes to performance. We work closely with browser engineers to get the maximum performance possible out of Preact.
Portable & Embeddable
Use Preact to build parts of an app without complex integration. Embed Preact into a widget and apply the same tools and techniques that you would to build a full app.
Lightweight is a lot more fun when you don’t have to sacrifice productivity to get there. Preact gets you productive right away. It even has a few bonus features:
contextare passed to
- Use standard HTML attributes like
Virtual DOM Components make it easy to share reusable things – everything from buttons to data providers. Preact’s design means you can seamlessly use thousands of Components available in the React ecosystem.
Adding a simple preact/compat alias to your bundler provides a compatibility layer that enables even the most complex React components to be used in your application.