TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

It is proposed to add support for multiple jsx factory functions.

Open textbus opened this issue 3 years ago • 3 comments

Suggestion

In the same project, when multiple jsx factory functions are required, there will always be complex configurations and type conflicts. It is recommended that you configure file suffixes and type spaces for multiple factory functions in one tsconfig.json. For example:

{
    "compilerOptions": {
        "jsxResolver": [{
            "ext": ".react.tsx",
            "jsxImportSource": "react"
        }, {
            "ext": ".vue.tsx",
            "jsxImportSource": "vue"
        }, {
            "ext": ".mylib.tsx",
            "jsxImportSource": "my-lib"
        }, {
            ...
        }]
    }
}

🔍 Search Terms

jsx factory, multiple jsx factory, custom jsx factory

✅ Viability Checklist

My suggestion meets these guidelines:

  • [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [x] This wouldn't change the runtime behavior of existing JavaScript code
  • [x] This could be implemented without emitting different JS based on the types of the expressions
  • [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • [x] This feature would agree with the rest of TypeScript's Design Goals.

textbus avatar Dec 26 '22 03:12 textbus

+1 for this. It would greatly improve the DX in multi-framework environments like Astro.

Enteleform avatar Sep 15 '23 11:09 Enteleform

Are there any updates to this feature?

Christoph-Koschel avatar Aug 17 '24 19:08 Christoph-Koschel

Are there any updates to this feature?

TenviLi avatar Oct 16 '24 18:10 TenviLi