SolidJS Tutorial
Learn SolidJS step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is SolidJS? Meet SolidJS, the JavaScript UI library built on signals: what it is, how it differs from virtual-DOM libraries, and why it is so fast.
- Setting Up and Your First SolidJS App Create a SolidJS project with the official templates, understand every file in it, and learn how render mounts a component and returns a dispose function.
- How SolidJS Works: Compiler and Reactive Graph Understand what the Solid compiler produces, how signals track dependencies automatically, and why the same DOM nodes survive every update.
- SolidJS vs React: Mental Model Differences Coming from React? Map useState, useEffect and useMemo to Solid, learn why props must not be destructured, and avoid the classic first-week mistakes.
Signals and Reactivity
- Creating Signals with createSignal Master createSignal in SolidJS: read and write values, use the updater form, update arrays and objects safely, and control equality with the equals option.
- Side Effects with createEffect Learn createEffect in SolidJS: when effects run, how dependencies are tracked, how to clean up, the previous-value argument and mistakes to avoid.
- Derived Values and createMemo Learn how derived values work in SolidJS: plain functions, createMemo caching, equality checks, memo chains and when a memo is not worth it.
- Batching, untrack and on Control reactivity in SolidJS: group writes with batch, read without subscribing using untrack, and set explicit dependencies with on and defer.
- Ownership, Roots and Cleanup Understand the SolidJS reactive owner tree: how effects are disposed, what createRoot does, why onCleanup works and how to use runWithOwner safely.
- Component Lifecycle: onMount and onCleanup Learn the SolidJS component lifecycle: components run once, onMount runs after the DOM exists, onCleanup tears down, and how to use refs safely.
JSX and Control Flow
- JSX in Solid: Expressions and Fine-Grained Updates Learn how JSX works in SolidJS: reactive expressions, dynamic attributes and styles, spreading props, fragments, and what the compiler does to your markup.
- Conditional Rendering: Show, Switch and Match Render conditionally in SolidJS with Show, fallback, keyed and callback children, and Switch and Match for multiple branches, with live examples.
- Lists with For and Index Render lists in SolidJS with For and Index: reference versus index keying, the index accessor, fallbacks, nested lists and performance tips.
- Dynamic, Portal and ErrorBoundary Use SolidJS control-flow helpers: Dynamic for runtime components, Portal for modals and overlays, ErrorBoundary for failures and the NoHydration idea.
- Events, Styling and classList Handle DOM events in SolidJS with onClick and on: prefixes, event delegation, bound handlers, plus dynamic style, class and classList patterns.
- Refs and Custom Directives Get DOM elements in SolidJS with ref, forward refs through components, and write reusable behavior with the use: directive pattern and cleanup.
Components and Props
- Components and Props in SolidJS Learn how to write SolidJS components: functions that run once, props as reactive getters, passing functions and signals, default values and typing.
- Props and Reactivity: splitProps and mergeProps Handle props safely in SolidJS: why destructuring breaks, defaults with mergeProps, splitProps for wrappers, forwarding rest props, and the children helper.
- Children and Composition in SolidJS Compose SolidJS components with props.children, the children helper, named slots, render props and callback children, and avoid duplicate rendering.
- Forms and Controlled Inputs in SolidJS Build forms in SolidJS: bind inputs, checkboxes, radios and selects to signals, validate with memos, handle submit, and wrap fields in reusable components.
Stores and Context
- Stores with createStore Learn how SolidJS createStore tracks nested objects and arrays property by property, how the path syntax of setStore works, and when to pick a store over signals.
- Updating Stores: produce, reconcile and unwrap Use produce for mutable-style updates, reconcile to diff fresh server data into a store, and unwrap to get plain objects. Includes createMutable and its trade-offs.
- The Context API Share signals and stores across a component tree with SolidJS context. Learn createContext, Provider, useContext, safe custom hooks, nested providers and typical patterns.
- Global State Patterns Compare the three ways to share state in SolidJS: module-level signals, module-level stores and context providers, and learn when each one is the right choice.
- Persisting State and Undo History Save SolidJS signals and stores to localStorage with an effect, restore them safely on load, and build undo and redo with store snapshots and the unwrap helper.
Resources, Suspense and Async
- Loading Data with createResource Learn createResource in SolidJS: fetch async data, react to a source signal, read loading and error state, refetch, mutate locally and set an initial value.
- Suspense and Transitions Show loading states declaratively with Suspense, order reveals with SuspenseList and keep old content on screen during updates with useTransition in SolidJS.
- Error Boundaries and Lazy Loading Catch rendering and resource errors with ErrorBoundary and reset them, then split your bundle with lazy components and dynamic imports in SolidJS.
- Async Patterns: Debounce, Optimistic Updates, Polling Practical async recipes for SolidJS: debounce a search signal, cancel stale work with onCleanup, update the UI optimistically with rollback, and poll safely.
SolidStart and Routing
- SolidStart Overview Meet SolidStart, the full-stack framework for SolidJS: project layout, server rendering and streaming, rendering modes, deployment presets and how it differs from plain Solid.
- File-Based Routing How SolidStart turns files in src/routes into URLs, with dynamic and catch-all segments, route groups, nested layouts, links, params and programmatic navigation.
- Route Data: query and createAsync Load data for routes with Solid Router query and createAsync, understand request deduplication, preloading and revalidation, and see how it works with SSR.
- Server Functions, Actions and API Routes Run code on the server with use server, mutate data with actions and forms, track submissions, add API routes and middleware, and keep secrets out of the browser.
Testing and Performance
- Testing Solid Components and Reactive Code Test SolidJS code with Vitest and Solid Testing Library, test signals and effects inside createRoot, test async components and learn the pitfalls that fail tests.
- Performance: Fine-Grained Updates in Practice Make SolidJS apps fast in practice. Measure updates, avoid accidental reruns, use createMemo, batch, createSelector, keyed lists, untrack and smaller bundles.
- Debugging and Developer Tools Debug SolidJS apps. Trace signal reads and writes, fix lost reactivity, log stores correctly, understand common warnings and hydration mismatches, and use Solid DevTools.
Projects and Practice
- Project: A Todo App with Stores and Filters Build a complete SolidJS todo app step by step: a store with actions, derived counts with createMemo, filters, inline editing and a clean component structure.
- Project: A Live Search with Debounce and Suspense Build a live search in SolidJS with a debounced input, createResource, Suspense, an ErrorBoundary, keyboard navigation and highlighted matches, step by step.
- Practice: SolidJS Challenges Ten SolidJS exercises on signals, memos, stores, context, resources and control flow, each with a self-checking solution you can run and modify in the browser.