KC's Workspace
    Preparing search index...

    Configure how TSX and JSX are transformed.

    interface JsxOptions {
        development?: boolean;
        importSource?: string;
        pragma?: string;
        pragmaFrag?: string;
        pure?: boolean;
        refresh?: boolean | ReactRefreshOptions;
        runtime?: "classic" | "automatic";
        throwIfNamespace?: boolean;
        useBuiltIns?: boolean;
        useSpread?: boolean;
    }
    Index

    Properties

    development?: boolean

    Emit development-specific information, such as __source and __self.

    importSource?: string

    Replaces the import source when importing functions.

    'react'
    
    pragma?: string

    Replace the function used when compiling JSX expressions. It should be a qualified name (e.g. React.createElement) or an identifier (e.g. createElement).

    Only used for classic runtime.

    'React.createElement'
    
    pragmaFrag?: string

    Replace the component used when compiling JSX fragments. It should be a valid JSX tag name.

    Only used for classic runtime.

    'React.Fragment'
    
    pure?: boolean

    Enables @babel/plugin-transform-react-pure-annotations.

    It will mark JSX elements and top-level React method calls as pure for tree shaking.

    refresh?: boolean | ReactRefreshOptions

    Enable React Fast Refresh .

    Conforms to the implementation in https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh

    false
    
    runtime?: "classic" | "automatic"

    Decides which runtime to use.

    • 'automatic' - auto-import the correct JSX factories
    • 'classic' - no auto-import
    'automatic'
    
    throwIfNamespace?: boolean

    Toggles whether or not to throw an error if an XML namespaced tag name is used.

    Though the JSX spec allows this, it is disabled by default since React's JSX does not currently have support for it.

    true
    
    useBuiltIns?: boolean

    When spreading props, use Object.assign directly instead of an extend helper.

    Only used for classic runtime.

    false
    
    useSpread?: boolean

    When spreading props, use inline object with spread elements directly instead of an extend helper or Object.assign.

    Only used for classic runtime.

    false