-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Intellisense/import Code Actions don't work with React JSX Transform unless React is in scope #50192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The expected behavior is only enabled if you set the |
I initially had it set to |
Is this a "real" behavior, or a quirk of Expo's build system? The React Native docs do not show examples without the React import. It's quite explicit:
|
I just checked, Expo is using a slightly tweaked version of |
@andrewbranch thoughts on making auto-import just not care about |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@RyanCavanaugh I saw that this was closed automatically. If you guys decide to make any changes to this behavior and reference this issue, will I be notified even if it's closed? |
Yes |
@nhuesmann I know I said 'yes' above but I'm not sure if the above PR actually triggered a notification, so I'll mention you just to be sure 😉 |
Does this issue occur when all extensions are disabled?: Yes
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 toApp.tsx
without the import.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"
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)
The text was updated successfully, but these errors were encountered: