Edit on val.town ↗

HTML & JSX

Use JSX in Val Town with modern frontend frameworks like React, Preact, Vue, Solid, and Hono.

To use JSX, you'll need to insert what TypeScript calls a "per-file pragma" - a comment that uses @jsxImportSource to specify where the JSX methods are going to come from. For example, if you're implementing JSX with Preact, the pragma will look like this at the top of your file:

/** @jsxImportSource https://esm.sh/react */

With React:

With Preact:

With Vue:

With Solid:

With Hono:

Are we missing your JSX framework of choice? Feel free to ask us, or open a branch to update this docs page.

Last updated