Regression issue with React import when using "jsx": "react"
compiler
#59117
Labels
Milestone
"jsx": "react"
compiler
#59117
π Search Terms
"verbatimModuleSyntax", "ts6133, "react", "jsx"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?noUnusedLocals=true&noUnusedParameters=true&target=7&verbatimModuleSyntax=true&isolatedModules=false&allowSyntheticDefaultImports=false#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wG4AocpAD0ljkwFcA7DYCZuAYV0maWYwAjAAoAlHADe5OHCIxGUTgB4AJsABucAPQA+CgF9yQA
π» Code
π Actual behavior
When using
"jsx": "react"
in the compiler option, we are still required to import React in our components. Now with the version 5.5 of typescript doing such import in conjunction withverbatimModuleSyntax
returns an unused import error because the code doesn't directly refer to the React import before its transpiled.π Expected behavior
This kind of import should not raise any errors as this is required for the code to work at runtime.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: