Back to articles
SolidJS Has a Free API — Here's How to Build Reactive UIs Without Virtual DOM

SolidJS Has a Free API — Here's How to Build Reactive UIs Without Virtual DOM

via Dev.to JavaScriptAlex Spinov

SolidJS is a reactive JavaScript framework that compiles to real DOM operations — no virtual DOM diffing. It delivers React-like DX with performance that rivals vanilla JS. Getting Started npx degit solidjs/templates/ts my-app cd my-app npm install npm run dev Signals — Fine-Grained Reactivity import { createSignal , createEffect } from " solid-js " ; function Counter () { const [ count , setCount ] = createSignal ( 0 ); const doubled = () => count () * 2 ; createEffect (() => { console . log ( `Count: ${ count ()} , Doubled: ${ doubled ()} ` ); }); return ( < div > < p > Count: { count () } (doubled: { doubled () } ) </ p > < button onClick = { () => setCount ( c => c + 1 ) } > Increment </ button > </ div > ); } createResource — Data Fetching import { createResource , Suspense } from " solid-js " ; const fetchUser = async ( id : string ) => { const res = await fetch ( `https://api.github.com/users/ ${ id } ` ); return res . json (); }; function UserProfile ( props : { userId : string

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
2 views

Related Articles