Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

jsx option should be "preserve" #67

@Fredx87

Description

@Fredx87

In the "Using JSX" section there is this instruction:

Update your tsconfig.json to set "jsx" to "react".

I think that the right value should be "preserve", since the TypeScript documentation says that

The preserve mode will keep the JSX as part of the output to be further consumed by another transform step (e.g. Babel)

If I understand correctly the JSX transformation is not performed by @babel/preset-typescript but by @babel/preset-react, so what is the point to declare a JSX transformation in the tsconfig? Setting preserve can also be useful for supporting the new JSX transform: in the tsconfig we can specify always preserve and let babel decide how to transform the JSX code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions