-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.70.0
- OS Version: Mac OS 12.4
Steps to Reproduce:
I created a reproducible demo using npx create-expo-app -t expo-template-blank-typescript
. The only change I made was adding the basic React component and adding it to App.tsx
without the import.
- Clone the reproducible demo I created
https://github.com/nhuesmann/vscode-react-jsx-transform-issue
cd <my-repo-you-cloned>
- Install dependencies:
npm i
oryarn
code --disable-extensions .
- Open
App.tsx
- Notice the error on line 8 with the
<Test />
component - Click on the component and use
cmd + .
to bring up Code Actions - Observe VS Code's suggestion:
import 'React' from "react"
- Accept the suggestion
- Once again use
cmd + .
(while clicked on<Test />
) to bring up Code Actions - Observe VS Code's suggestion of
Add import from "./Test"
The second suggestion should be suggested initially, since React's JSX Transform does not require React
to be in scope. VS Code will not do JSX import suggestions unless React is in scope.
Related issue: #41762
Temporary workaround: #41762 (comment)
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug