Frameworks

Which React frameworks a Twilight theme can run on, and which parts of your theme depend on the choice.

Read this to know which parts of your theme are tied to a framework and which are not.

The engine is built to run on more than one React framework. Today you can use one, and a second is planned.

FrameworkStatus
TanStack StartThe default. Every page in this documentation is written for it.
Next.jsPlanned. Not available yet.

New themes use TanStack Start. You do not have to choose anything: twilightReact() defaults to "tanstack".

What depends on the framework

Most of a theme does not care which framework runs it. The framework only decides how URLs reach your code and how a page's head and links are wired.

Same on every frameworkSpecific to the framework
API client and modulesRoute files in app/routes/ and the app/routes.ts list
Hooks and componentsapp/router.tsx, app/start.ts, app/client.tsx and app/hydrate.tsx
Translations, useTranslation and RTLThe generated route tree, app/routeTree.gen.ts
twilight.json, settings and home blocksLoaders and head (createFileRoute, withHead, getTwilightContext)
Styling and layoutThe framework option of twilightReact()
Local development with the Salla CLIRequest middleware

A page that depends on the framework says so at the top, in a "Framework: TanStack Start" note. A page without that note works the same everywhere.

What this means for you today

  • Write routes the way the Routes tab shows. Those examples are TanStack Start.
  • Keep logic that does not need a framework in hooks, components and API calls. That code carries over when another framework arrives.
  • Keep framework code (createFileRoute, loaders, head) in app/routes/ and app/router.tsx, so it stays in one place.

When Next.js arrives, pages that differ will show both versions side by side. Pages that do not differ will stay as they are.

Next

Quick start: create and run your first theme.

On this page