DEV Community

Arhan Khan
Arhan Khan

Posted on

SolidJS for Beginners: React-Like Code That Runs Without a Virtual DOM

SolidJS looks like React — components, JSX, hooks — but under the hood it works completely differently. There is no virtual DOM, no re-rendering whole components, and no diffing. Instead, Solid compiles your JSX into tiny, precise updates that change only the exact DOM node that needs changing. The result is a framework that feels familiar and performs like hand-written vanilla JavaScript.

The key idea is fine-grained reactivity. In React, changing state re-renders the component. In Solid, state is a signal, and only the exact piece of the UI that reads that signal updates. Everything else stays untouched. That is why Solid apps are famously fast and small.

import { createSignal } from "solid-js";

function Counter() {
  const [count, setCount] = createSignal(0);

  return (
    <button onClick={() => setCount(count() + 1)}>
      Clicked {count()} times
    </button>
  );
}
Enter fullscreen mode Exit fullscreen mode

Getting started is simple. Run npm create solid@latest, pick the basic template, and you have a working app. If you know React, you will feel at home within an hour — the syntax is close, and the docs have a comparison page that maps every React concept to its Solid equivalent.

SolidJS is for React developers who want more speed, beginners who want to learn reactivity properly, and teams building interactive apps where performance matters — dashboards, editors, and data-heavy pages. It is also a great way to understand how signals work, since the same idea now powers Angular, Vue, and Svelte 5.

The limits are honest. Solid has a much smaller community than React, fewer ready-made component libraries, and fewer job listings. Some React patterns — like rendering lists of components with changing order — work differently, and you will need to unlearn a few habits.

Start today with one thing: build a counter and a small todo list in Solid, then open your browser's performance tools and watch how little work an update does. In a week you will understand reactivity at a level most React developers never reach.

Top comments (1)

Collapse
 
alexshev profile image
Alex Shev •

The useful mental model for fine-grained reactivity is not simply ‘faster React,’ but an explicit dependency graph. I’d show one example where a broad reactive read causes unnecessary work and then narrow it with a memo or selector, measured in a small profiler trace. That teaches the trade-off without turning performance claims into folklore.