← All notes

JSX in TypeScript

Answer: TypeScript type-checks JSX in .tsx files and compiles it according to the jsx compiler option.

Setup

{ "compilerOptions": { "jsx": "react-jsx" } }

Name files .tsx. As a result, TypeScript disallows angle bracket type assertions in .tsx files. (S1)

jsx modes

| Mode | Output | |---|---| | preserve | .jsx, JSX unchanged | | react-jsx | .js, _jsx calls for production | | react-jsxdev | .js, _jsx calls for development | | react-native | .js, JSX unchanged |

Typing components

type Props = { name: string };
function Hello({ name }: Props) { return <p>Hello {name}</p>; }
<Hello name="Ada" />;    // OK
<Hello />;               // error: name is missing

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: TypeScript (Microsoft), TypeScript: Documentation - JSX, CC BY 4.0 (microsoft/TypeScript-Website); TypeScript (Microsoft), TypeScript: TSConfig Option: jsx, CC BY 4.0 (microsoft/TypeScript-Website).

Cite this

Permanent ID: iil:note:fg5y18tx

iinventedlight. 2026. "JSX in TypeScript." iinventedlight Library, iil:note:fg5y18tx, version of 2026-11-04. https://iinventedlight.com/library/notes/typescript-jsx/. License: CC-BY-4.0.

@misc{iil_note_fg5y18tx,
  author = {{iinventedlight}},
  title = {{JSX in TypeScript}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/typescript-jsx/},
  note = {Permanent ID iil:note:fg5y18tx. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/typescript-jsx.md.