-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
"verbatimModuleSyntax", "ts6133, "react", "jsx"
π Version & Regression Information
- This changed between versions 5.4.5 and 5.5.3
β― Playground Link
π» Code
import React from 'react';
export function Component1() {
return <div />;
}
π 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 with verbatimModuleSyntax
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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue