You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code react JSX transform intellisense code action react in scope
π Version & Regression Information
I was unable to test this on prior versions because I previously didn't use the JSX Transform.
β― Playground Link
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 or yarn
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"
π Actual behavior
VS Code's Intellisense does not suggest the JSX component import initially. It only suggests importing React. This is wrong, because with the React JSX Transform, it is no longer necessary to import React in JSX/TSX files.
π Expected behavior
VS Code should suggest Add import from "./Test" on first use of cmd + .
Sorry, what's the difference between this and #50192 ?
I wasn't sure which repo to create the issue in (TypeScript or VS Code) so I reported it in both. I didn't realize the VS Code one would be automatically created over here, I'm sorry for the excess issue creation. It's the same issue, I just followed each repo's instructions for bug reporting.
Bug Report
π Search Terms
VS Code react JSX transform intellisense code action react in scope
π Version & Regression Information
β― Playground Link
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 toApp.tsx
without the import.Reproducible Example
π» Steps to reproduce
https://github.com/nhuesmann/vscode-react-jsx-transform-issue
cd <my-repo-you-cloned>
npm i
oryarn
code --disable-extensions .
App.tsx
<Test />
componentcmd + .
to bring up Code Actionsimport 'React' from "react"
cmd + .
(while clicked on<Test />
) to bring up Code ActionsAdd import from "./Test"
π Actual behavior
VS Code's Intellisense does not suggest the JSX component import initially. It only suggests importing React. This is wrong, because with the React JSX Transform, it is no longer necessary to import React in JSX/TSX files.
π Expected behavior
VS Code should suggest
Add import from "./Test"
on first use ofcmd + .
Extra
Related issue: #41762
Temporary workaround: #41762 (comment)
The text was updated successfully, but these errors were encountered: