HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
preactjs
preact
JavaScript2015–2024
preactjs / preact

preact

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

50Distinct people
52Mentions
0Explicit recommenders
39KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year52 dated mentions

Observed mentions: 2015-12-04 01:50:28 UTC to 2024-04-01 11:05:28 UTC.

0510152015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 14 mentions; 3 submissions, 11 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 16 mentions; 2 submissions, 14 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 7 mentions; 5 submissions, 2 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2024

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC110
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC14311
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC16214
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC752
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC321
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC303
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC202
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC413
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Fast 4kB alternative to React with the same modern API. All the power of Virtual DOM components, without the overhead: Familiar React API & patterns: ES6 Class, hooks, and Functional Components Extensive React compatibility via a simple preact/compat alias Everything you need: JSX, VDOM, DevTools, HMR, SSR. Highly optimized diff algorithm and seamless hydration from Server Side Rendering Supports all modern browsers Transparent asynchronous rendering with a pluggable scheduler 💁 More information at the Preact Website ➞ You can find some awesome libraries in the awesome-preact list 😎 Getting Started 💁 Note: You don't need ES2015 to use Preact... but give it a try! Tutorial: Building UI with Preact With Preact, you create user interfaces by assembling trees of components and elements. Components are functions or classes that return a description of what their tree should output. These descriptions are typically written in JSX (shown underneath), or HTM which leverages standard JavaScript Tagged Templates. Both syntaxes can express trees of elements with "props" (similar to HTML attributes) and children. To get started using Preact, first look at the render() function. This function accepts a tree description and creates the structure described. Next, it appends this structure to a parent DOM element provided as the second argument. Future calls to render() will reuse the existing tree and update it in-place in the DOM. Internally, render() will calculate the difference from previous outputted structures in an attempt to perform as few DOM operations as possible. import { h, render } from 'preact'; // Tells babel to use h for JSX. It's better to configure this globally. // See https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#usage // In tsconfig you can specify this with the jsxFactory /** @jsx h */ // create our tree and append it to document.body: render( <main> <h1>Hello</h1> </main>, document.body ); // update the tree in-place: render( <main> <h1>Hello World!</h1> </main>, document.body ); // ^ this second invocation of render(...) will use a single DOM call to update the text of the <h1> Hooray! render() has taken our structure and output a User Interface! This approach demonstrates a simple case, but would be difficult to use as an application grows in complexity. Each change would be forced to calculate the difference between the current and updated structure for the entire application. Components can help here – by dividing the User Interface into nested Components each can calculate their difference from their mounted point. Here's an example: import { render, h } from 'preact'; import { useState } from 'preact/hooks'; /** @jsx h */ const App = () => { const [input, setInput] = useState(''); return ( <div> <p>Do you agree to the statement: "Preact is awesome"?</p> <input value={input} onInput={e => setInput(e.target.value)} /> </div> ); }; render(<App />, document.body); Sponsors Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]             Backers Support us with a monthly donation and help us continue our activities. [Become a backer] License MIT
Read the full README on GitHub

What Hacker News says

52 sources
We built Druthers to make democratic decisions as a team. It derives results through a ranked-choice voting algorithm that I encourage you to try and game! And, importantly, it is almost no fun whatsoever to use this app without another person, preferably live over the (video) phone or in-person. Druthers' first incarnation was built with Rails and JQuery on a team of four. The second on Firebase, solo. This one passes CRDTs over WebRTC because, of course, and we pair-programmed it. It's is an exercise in moderate minimalism. Smallish build toolchain, fewish dependencies, unambitious UX. We built it with preact[0], snowpack[1], and taste[2]. 0. https://github.com/preactjs/preact 1. https://github.com/FredKSchott/snowpack 2. https://github.com/benchristel/taste
In Show HN: Druthers, Multiplayer Decision-Making
A regular global variable that is incremented each time you call useState/useEffect/etc and is resetted every time a new component starts rendering. This is why hook order must be maintained. I have no idea where this is implemented in React, but in Preact it's a simple integer that is incremented: https://github.com/preactjs/preact/blob/abc162c4d6442d5495f6... I think there are other ways to implement them, such as treating the return of the render function as an AST and turning hooks into dumb factories, like a free monad. But considering the constraints they have (the need to maintain order) and the way it works (the fact the render function runs multiple times), I'm guessing it's just the same solution as Preact.
In Thinking in React Hooks

Showing the 15 most recent of 52 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.