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 */React
With React:
Preact
With Preact:
Vue
With Vue:
Solid
With Solid:
Hono
With Hono:
Missing your favorite framework?
Are we missing your JSX framework of choice? Feel free to ask us, or open a branch to update this docs page.
Last updated