Update JSX documentation - #3064
Conversation
This adds some missing information about using JSX in TypeScript. - Add the `react-jsx` and `react-jsxdev` modes in the introduction. Also mention they are called the classic and automatic runtime. - Specify where frameworks need to specify the `JSX` namespace. - Clarify which `jsx` options use which type definitions. - Specify that JSX runtimes must use package exports in order to support ESM. - Fix syntax highlighting in JSX code blocks. - Document that users may use the `@jsxRuntime` comment to override the `jsx` option on a per-file basis.
|
Is there anyone who might be able to help verify this? Wesley Wigham (@weswigham) maybe? Daniel Rosenwasser (@DanielRosenwasser)? |
|
I can at least confirm that this is how I model the JSX support in my head (I think people are re-looking at this because React 19 is starting to come out) after giving it a look though. The only bits I'm not certain of are the ESM support docs, because I've not had to interact with that system. Feels reasonable to me though. |
|
Missing package exports are the reason why the automatic runtime in |
The JSX mode does affect type checking.
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
Since it’s also possible to define the `JSX` namespace globally, `needs to` is a bit to strong. It was replaced with `should`.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-plant-05c166c10-3064.centralus.5.azurestaticapps.net |
|
Gave this a reread, and everything seems to check out to me. |
This adds some missing information about using JSX in TypeScript.
react-jsxandreact-jsxdevmodes in the introduction. Also mention they are called the classic and automatic runtime.JSXnamespace.jsxoptions use which type definitions.@jsxRuntimecomment to override thejsxoption on a per-file basis.