-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update JSX documentation #3064
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? @weswigham maybe? @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 <[email protected]>
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-jsx
andreact-jsxdev
modes in the introduction. Also mention they are called the classic and automatic runtime.JSX
namespace.jsx
options use which type definitions.@jsxRuntime
comment to override thejsx
option on a per-file basis.