# Newstack — AI Reference Guide Newstack is a full-stack SSR/SSG/SPA framework with proxy-based reactivity, no virtual DOM, and an esbuild bundler. Components run on both server and client. **This is not React, Vue, or Svelte.** Do not apply patterns from those frameworks. No JSX imports, no hooks, no stores, no signals, no className, no onClick, no style objects, no key reconciliation. --- ## Component Anatomy ```tsx import Newstack, { type NewstackClientContext } from "newstack"; export class Counter extends Newstack { // State: plain class properties. Setting them triggers re-render automatically. count = 0; // Runs on server (SSR) AND on client before first render. // Use for data fetching, initializing state from context. prepare(context: NewstackClientContext) { context.page.title = "Counter"; } // Runs on client only, after DOM is painted. Use for subscriptions, timers, etc. hydrate(context: NewstackClientContext) { console.log("mounted"); } // Runs on client whenever any property on this component changes. update(context: NewstackClientContext) {} // Runs on client when component is removed from DOM. destroy(context: NewstackClientContext) {} // Required. Runs on server (SSR) and client. Returns JSX. render(context: NewstackClientContext) { return