Skip to content

HTML & JSX

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 */

We recommend using React:

Preact is a great alternative to React: