Enum tsconfig::Jsx [−][src]
pub enum Jsx { React, ReactJsx, ReactJsxdev, ReactNative, Preserve, }
Controls how JSX constructs are emitted in JavaScript files. This only affects output of JS files that started in .tsx files.
For example, this sample code:
export const helloWorld = () => <h1>Hello world</h1>;
Default: “react”
export const helloWorld = () => React.createElement("h1", null, "Hello world");
Preserve: “preserve”
export const helloWorld = () => <h1>Hello world</h1>;
React Native: “react-native”
export const helloWorld = () => <h1>Hello world</h1>;
React 17 transform: “react-jsx”
import { jsx as _jsx } from "react/jsx-runtime";
export const helloWorld = () => _jsx("h1", { children: "Hello world" }, void 0);
React 17 dev transform: “react-jsxdev”
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
const _jsxFileName = "/home/runner/work/TypeScript-Website/TypeScript-Website/packages/typescriptlang-org/index.tsx";
export const helloWorld = () => _jsxDEV("h1", { children: "Hello world" }, void 0, false, { fileName: _jsxFileName, lineNumber: 7, columnNumber: 32 }, this);
Variants
Emit .js files with JSX changed to the equivalent React.createElement calls
Emit .js files with the JSX changed to _jsx calls
Emit .js files with the JSX to _jsx calls
Emit .js files with the JSX unchanged
Emit .jsx files with the JSX unchanged
Trait Implementations
impl<'de> Deserialize<'de> for Jsx
[src]
impl<'de> Deserialize<'de> for Jsx
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl StructuralPartialEq for Jsx
[src]
impl StructuralPartialEq for Jsx
[src]Auto Trait Implementations
impl RefUnwindSafe for Jsx
impl RefUnwindSafe for Jsx
impl UnwindSafe for Jsx
impl UnwindSafe for Jsx
Blanket Implementations
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]