[]previous and next page

Project setup

Project setup in the React to ShadowJS guide.

For agentsUpdated

A ShadowJS app is a Vite app. The Vite plugin compiles JSX to DOM operations; there is no React runtime and no react-dom.

vite.config.tsts
import shadow from "@shadow-js/vite";
import { defineConfig } from "vite";

export default defineConfig({ plugins: [shadow()] });

In tsconfig.json, point the JSX settings at ShadowJS and keep "jsx": "preserve":

json
{
  "compilerOptions": {
    "jsx": "preserve",
    "jsxImportSource": "@shadow-js/web",
    "strict": true,
    "types": ["vite/client"]
  }
}

Install with npm install @shadow-js/core @shadow-js/web and npm install -D @shadow-js/vite.