Public
Minimal Preact starter example with client-side hydration
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Preact Client Starter

Minimal Preact starter example with client-side hydration

View Demo

How it works

The http.tsx file renders the HTML Preact component on the server. This component includes a <script> tag that requests the client.ts module in the browser. This module hydrates the <div id="app"> element with the App component to allow you to use client-side state.