π Search Terms
jsxRuntime
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about jsxRuntime
β― Playground Link
https://www.typescriptlang.org/play/?jsx=4&ts=5.6.0-dev.20240717#code/PQKgBAAgVgzgHgJQK4DsAuBLAtgUzAYwBsBDGGDfMEYAKBzgAcB7AJzQKZRnYAkdDCTAOqtCAEzABeMAAoAlFIB8YADwALAIyK+ApmADuosSuCbFAbiA
π» Code
/* @jsxRuntime classic */
export const HelloWorld = () => <h1>Hello world</h1>;
π Actual behavior
The jsxRuntime pragma is not respected and function emit follows the jsx option in the TSConfig.
For example, with "jsx": "react-jsx", the function is emitted as
export const HelloWorld = () => _jsx("h1", { children: "Hello world" })
π Expected behavior
The jsxRuntime pragma is respected and the function is emitted as
export const HelloWorld = () => React.createElement("h1", null, "Hello world")
Additional information about the issue
The code above is copied verbatim from the TSConfig Reference
π Search Terms
jsxRuntime
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?jsx=4&ts=5.6.0-dev.20240717#code/PQKgBAAgVgzgHgJQK4DsAuBLAtgUzAYwBsBDGGDfMEYAKBzgAcB7AJzQKZRnYAkdDCTAOqtCAEzABeMAAoAlFIB8YADwALAIyK+ApmADuosSuCbFAbiA
π» Code
π Actual behavior
The
jsxRuntimepragma is not respected and function emit follows thejsxoption in the TSConfig.For example, with
"jsx": "react-jsx", the function is emitted asπ Expected behavior
The
jsxRuntimepragma is respected and the function is emitted asAdditional information about the issue
The code above is copied verbatim from the TSConfig Reference