Version: 2.0.0 (latest)
JSX Server-Side Rendering
You are reading the documentation for version 2 of FoalTS. Instructions for upgrading to this version are available here. The old documentation can be found here.
--
If you are interested in SSR without JSX, then you might take a look at the "templating" page.
#
Compile JSX FilesThe TypeScript compiler supports JSX.
To enable this feature, update the tsconfig.json
as follows:
Then, add the file extension tsx
in every tsconfig.*.json
.
Example with tsconfig.app.json
Every file using JSX must now have the extension .tsx
.
#
Example with ReactThis example shows how to use JSX SSR with React. It assumes that templates
directory is in the root, next to src
.
view.controller.tsx
./templates/index.html