# SolidJS Documentation > Documentation for the Solid 2.0 release candidate, including reactivity, web rendering, routing, metadata, and Vite integration. For a single-file corpus, use [llms-full.txt](https://deploy-preview-1657--solid-docs-v2.netlify.app/llms-full.txt). For a short primer with one line per solid-js export, use [llms-small.txt](https://deploy-preview-1657--solid-docs-v2.netlify.app/llms-small.txt). ## Overview - [Overview](https://deploy-preview-1657--solid-docs-v2.netlify.app/index.md): What Solid is, what these docs cover, and where to start reading. ## Getting Started - [Quick start](https://deploy-preview-1657--solid-docs-v2.netlify.app/getting-started/quick-start.md): Go from an empty directory to a running Solid app with a change of your own in it, and meet the ideas the rest of the docs build on. - [Project shapes](https://deploy-preview-1657--solid-docs-v2.netlify.app/getting-started/project-shapes.md): Pick between the bare, basic, and fullstack templates by what your app needs on day one, knowing that moving up later changes configuration, not your code. ## Concepts - [Reactivity](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/reactivity.md): Signals, memos, and effects: how Solid tracks reads, why a component runs once, and how to tell when a value will update. - [Components and JSX](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/components-and-jsx.md): Components as functions that run once: props, children, control flow, refs, and the JSX rules that follow from that. - [Stores](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/stores.md): Hold a cart, a form, or any nested object in a store: update one property through a draft, derive filtered views with a projection, and load server data into the same proxy. - [Async reactivity](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/async-reactivity.md): Read a promise like a value: how async memos hold updates, when Loading shows a fallback, and how mutations settle. - [Boundaries](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/boundaries.md): Decide which part of the page shows a spinner, which part shows an error, and in what order regions appear, by placing Loading, Errored, and Reveal around the right subtree. - [Mutations](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/mutations.md): Move the cart's add, remove, and set-quantity writes to a server without changing the UI: actions, optimistic stores, refresh, and how a failed request undoes itself. - [Rendering and SSR](https://deploy-preview-1657--solid-docs-v2.netlify.app/concepts/rendering-and-ssr.md): Run the same components in the browser and on the server: keep browser-only code off the server, get matching HTML for hydration, and choose between string and streaming rendering. ## Building Apps - [App structure](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/app-structure.md): Know which two files in a start-mode project you edit, what the plugin generates around them, and when to replace a generated entry or hook a router into the server render. - [Styling and assets](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/styling-and-assets.md): Style a component with global CSS, a CSS module, Tailwind, or an inline style object, toggle classes without string building, and reference images so the built URL is hashed. - [Head and metadata](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/head-and-metadata.md): Give each page its own title and meta tags from the component that owns them, let a layout's defaults return when the page unmounts, and read a title from data that is still loading. ### Server Functions - [Server functions](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions.md): Move a database query or a secret out of the browser by marking a function with "use server", and recognize what that call becomes on the wire. - [Reads, streams, and live data](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/reads-and-live-data.md): Declare a product read that HTTP caches can store, stream order events from a server function, and keep a stock level connected when another shopper changes it. - [Arguments and security](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/arguments-and-security.md): Send arguments a server function can decode, and validate and authorize every call as if it came from a terminal, because it can. - [Mutations and responses](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/mutations-and-responses.md): Return a value, a redirect, a reload, or a 400 from a cart or account mutation, and control what a thrown error reveals in production. - [Metadata and transport](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/metadata-and-transport.md): Read a server-function request in the network tab, attach a header to every call, move the endpoint, and cancel one call in flight. - [Progressive enhancement](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/progressive-enhancement.md): Make the Add to cart form post to a server function before JavaScript loads, and know which part of that exchange core owns and which the router adds. - [Streaming AI responses](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/streaming-ai-responses.md): Forward a model's token stream through a server function into a store one chunk at a time, stop it from the browser or by asking a new question, and render the Markdown without re-rendering what has already landed. - [Durable generation](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/server-functions/durable-generation.md): Run an AI reply as a job that outlives the request that started it, store the reply as it grows, and deliver it through a live source so a closed tab loses nothing and two tabs read the same reply. - [Sessions and auth](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/sessions-and-auth.md): Build a signed cookie session on the request event, sign customers in and out from server functions, and authorize every server entry point against that session. - [Environment](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/environment.md): Declare environment variables once, read secrets on the server and public values in the browser through typed modules, and let the build fail when a secret would leak. - [Middleware and API routes](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/middleware-and-api-routes.md): Run code in front of every request with fetch-style middleware, share state with pages and server functions through the request event, and answer HTTP requests from route modules. - [Deployment](https://deploy-preview-1657--solid-docs-v2.netlify.app/building-apps/deployment.md): Put a start-mode build on a host: serve dist/client as static files, route everything else to the built request handler, supply the server environment at boot, and pick a Node server or a provider adapter. ## Routing - [Routing overview](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/overview.md): Choose between Solid Router and TanStack Router for a Solid app, mount the router in App, and decide whether routes come from an array or from files under src/routes. ### Solid Router - [Solid Router](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router.md): Build a small routed store with Solid Router: a product page that reads its id from the URL, a header that stays mounted, typed links, and route data that starts loading before the page renders. - [Setup](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/setup.md): Add Solid Router to a project that does not have it, mount one router at the application root, and set the options for a base path, hash history, or preloading. - [Route definitions](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/route-definitions.md): Write the route objects Solid Router matches against: path patterns with required, optional, and wildcard segments, typed parameters, match filters, metadata, lazy subtrees, and the file-system manifest. - [Nested routes and layouts](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/nested-routes.md): Wrap a group of pages in a shared layout, keep it mounted while pages change, share parameters down the tree, and load data at every level without a waterfall. - [Navigation and typed paths](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/navigation.md): Link between pages with plain anchors, build URLs the compiler checks, navigate from code, read the location and search parameters, show active and pending links, and guard against leaving a page. - [Data loading and mutations](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/data.md): Start route data early with preloads, cache and share reads with query, submit mutations with actions, show optimistic state, and control what revalidates. - [Server rendering and hydration](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/solid-router/server-rendering.md): Render Solid Router on the server: read the URL from the request, hydrate query results without a second fetch, return fresh data from a mutation in one round trip, and keep forms working without JavaScript. ### Tanstack - [TanStack Router](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/tanstack.md): Use TanStack Router and TanStack Query with Solid's server functions, streaming SSR, and single-flight mutations, as the fullstack-tanstack project shape does. - [Integrate a router](https://deploy-preview-1657--solid-docs-v2.netlify.app/routing/integrate-a-router.md): Wire a router that Solid does not ship into start mode: give it the request URL and a per-request instance, and connect it to the single-flight mutation transport. ## Guides - [Thinking in Solid](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/thinking-in-solid.md): Build the storefront's product search end to end, and at each step see what a React or Vue developer would reach for and what Solid does instead. - [Avoid unnecessary effects](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/avoid-unnecessary-effects.md): Recognize the effect that copies one reactive value into another, replace it with a direct, memoized, async, or writable derivation, and keep createEffect for the imperative boundary. - [Custom primitives](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/custom-primitives.md): Move repeated reactive setup into a createX function that runs inside an owner, accepts accessors, returns accessors, cleans up what it starts, and stays correct during server rendering. - [State management](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/state-management.md): Decide where each piece of storefront state lives: a component, a context provider, the URL, or the server, and keep it out of module scope in code that also runs on the server. - [Forms](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/forms.md): Build a form with a server function and a Solid Router action: it works before JavaScript loads, validates on the server, and after hydration shows pending state, inline errors, and the saved result before the server confirms. - [Lists](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/lists.md): Render, edit, filter, sort, select in, and window lists without rebuilding rows, and read the diagnostics that tell you when you are. - [Data fetching patterns](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/data-fetching-patterns.md): Load data for search, detail pages, pagination, shared state, and dashboards without loading flags, request counters, or abort controllers, and decide where each request and each boundary goes. - [Protected routes](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/protected-routes.md): Require a signed-in customer for the account area at the data, route, and request layers, redirect a signed-out visitor to sign-in on the server and in the browser, and send them back where they were going. - [SSR-safe code](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/ssr-safe-code.md): Keep browser APIs, per-run values, and client-only data out of the server render, and read each hydration warning to find the line that made the server and the browser disagree. - [Choose a rendering mode](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/choose-a-rendering-mode.md): Decide between a static shell, streaming server rendering, and build-time prerendering for a start-mode project, and what each one costs. - [Debugging reactivity](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/debugging-reactivity.md): Find out why a value does not update, why it updates too often, and how to read Solid's development diagnostics. - [Performance](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/performance.md): Measure a slow catalog page with the browser profiler and Solid's attribution tables, then fix the cause each measurement points at: hot derivations, wide writes, rebuilt rows, waterfalls, unsplit code, and a blocked streaming shell. - [TypeScript](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/typescript.md): Replace the any annotations in a storefront with the types Solid exports for props, children, accessors, store drafts, event handlers, refs, server function results, and typed routes. - [Integrate non-Solid code](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/integrate-non-solid-code.md): Drive a charting library, a map, a web component, or an analytics script from Solid state: get the DOM node at the right time, create the instance once, update it in an effect, and keep browser-only imports off the server. - [Testing](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/testing.md): Write a component test that clicks a button and asserts the label, run it in jsdom or a real browser, and test fullstack server code in a separate Node project. - [Observability](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/observability.md): Report the errors your boundaries catch in production, follow a request from the server into the browser, and see what each user interaction cost, without wrapping a component. - [Build an observability adapter](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/observability-adapters.md): Connect an error monitor or a tracing SDK to a Solid app through the runtime's hooks and channels, with nothing wrapped, patched, or rewritten. - [Solid for AI tools](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/ai-tools.md): Point a coding assistant at the cheatsheet, skills, diagnostics, lint configs, and Markdown docs that ship with Solid 2.0, and paste a rules block into its instructions file. - [Chat state for the AI SDK](https://deploy-preview-1657--solid-docs-v2.netlify.app/guides/ai-sdk-chat.md): Drive the AI SDK's chat class from a Solid store with a short ChatState adapter, so messages, status, and errors update the exact nodes that read them. ## Migration - [From Solid 1.x](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/from-solid-1.md): Migrate a Solid 1.x application to Solid 2, including package imports, reactivity, effects, stores, async data, rendering, and tests. - [Data fetching from Solid 1](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/data-fetching-from-solid-1.md): Move Solid 1 data loading patterns to async computations one fetch at a time, and decide per fetch whether an update should wait, dim, or show a placeholder. - [From SolidStart](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/from-solid-start.md): Move a SolidStart 1 or released SolidStart 2 application to Solid 2 through @solidjs/vite-plugin start mode. - [From Solid Router 0.x/1.x](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/from-solid-router.md): Migrate JSX routes and the Solid Router 0.x/1.x data APIs to a Solid Router 2 createRouter instance. - [From Solid Meta 0.x](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/from-solid-meta.md): Migrate your application from @solidjs/meta 0.x to 1.0. - [From React](https://deploy-preview-1657--solid-docs-v2.netlify.app/migration/from-react.md): Map familiar React concepts to their closest Solid concepts, with equivalent examples and the semantic differences that matter during migration. ## Glossary - [Glossary](https://deploy-preview-1657--solid-docs-v2.netlify.app/glossary.md): Solid's own words, each defined in a few sentences and linked to the page that teaches it. ## Reference - [Reference](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference.md): API reference for Solid: the reactive core, the web renderer, Solid Router, Solid Meta, the Vite plugin, and filesystem routing. ### solid-js - [solid-js](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js.md): Reference for the solid-js package: reactive primitives, stores, actions, context, flow components, and the public types. #### Reactivity - [createEffect](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/create-effect.md): Creates a reactive effect with separate compute and effect phases. - [createMemo](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/create-memo.md): Creates a readonly derived reactive memoized signal. - [createOptimistic](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/create-optimistic.md): Creates an optimistic signal — a `Signal` whose writes are tentative inside an `action`: they show up immediately, then auto-revert (or reconcile to the action's resolved value) once the pending work settles. - [createSignal](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/create-signal.md): Creates a simple reactive state with a getter and setter. - [flush](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/flush.md): Synchronously processes the pending reactive queue, or runs `fn` in a synchronous flush scope before draining the queue. - [isPending](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/is-pending.md): Returns whether the reactive reads inside `fn` depend on an in-flight value change that has not been revealed. - [latest](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/latest.md): Reads the freshest in-flight value available inside `fn`, falling back to the current settled value. - [untrack](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/reactivity/untrack.md): Runs `fn` outside of any reactive tracking — reads inside `fn` will not subscribe the current scope. Returns whatever `fn` returns. #### Stores - [createOptimisticStore](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/create-optimistic-store.md): The store equivalent of `createOptimistic`. - [createProjection](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/create-projection.md): Creates a derived (projected) store — `createMemo` for stores. The derive function receives a mutable draft and either mutates it in place (canonical) or returns a new value. - [createStore](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/create-store.md): Creates a deeply-reactive store backed by a Proxy. Reads track each property accessed; only the parts that change trigger updates. - [merge](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/merge.md): Merges multiple props-like objects into a single proxy that preserves reactivity. - [omit](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/omit.md): Returns a reactive proxy of `props` with the listed keys hidden. Tracking on the remaining keys is preserved. - [reconcile](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/stores/reconcile.md): Creates a store setter callback that merges new data into the existing store by key. #### Lifecycle Actions - [action](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/lifecycle-actions/action.md): The primitive for mutations: imperative async workflows whose writes span an async gap — optimistic write, server round-trip, reconciling write — where intermediate state must not leak and failure must revert cleanly (pair with `createOptimistic` / `createOptimisticStore`). - [affects](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/lifecycle-actions/affects.md): Marks a reactive source or store location as pending while work that will change it is in flight. - [onSettled](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/lifecycle-actions/on-settled.md): Schedules `callback` to run once after the reactive graph has fully settled — i.e. once every pending async read inside the current owner has resolved and the queue has flushed. - [refresh](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/lifecycle-actions/refresh.md): Invalidates one reactive source, forcing it to re-execute even if its inputs haven't changed, and returns a promise for the target's next settled state — the re-ask (and anything that supersedes it) has settled. - [until](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/lifecycle-actions/until.md): Awaits a reactive predicate and resolves the first time it becomes truthy, with the narrowed value. #### Components Context - [children](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/components-context/children.md): Resolves a `children` accessor and exposes the result as an accessor with a `.toArray()` helper. - [createContext](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/components-context/create-context.md): Creates a Context for sharing state with descendants of a Provider in the component tree. - [createUniqueId](https://deploy-preview-1657--solid-docs-v2.netlify.app/reference/solid-js/components-context/create-unique-id.md): Returns a stable id string that matches between server-rendered and client-hydrated trees. Use it for `