TSX file

A TypeScript file that may contain JSX markup, used for React components such as page.tsx.

In more detail

The x stands for JSX. Next.js special files such as page.tsx, layout.tsx and error.tsx use this extension because they return JSX, while files without markup, such as route.ts or middleware.ts, use .ts.

Related terms

Taught in

References