Skip to content

Deemphasize old JSX transform #246738

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eps1lon
Copy link

@eps1lon eps1lon commented Apr 16, 2025

The old JSX transform requires a React import so you get a "This JSX tag requires 'React' to be in scope, but it could not be found.ts(2874)" for files without a tsconfig in VSCode by default.

However, the default nowadays is the new, automatic JSX transform in React which doesn't need a React import so VSCode should default to that.

Related:

@RyanCavanaugh
Copy link
Member

What do you think about preserve instead? It's the most agnostic/forgiving, right?

@eps1lon
Copy link
Author

eps1lon commented Apr 17, 2025

The problem with preserve is that it would not pick up any JSX types in that case even if you have @types/react installed. And I guess if you don't have any types installed, it would also not try to download @types/react with automatic type aquisition?

I can see why it makes more sense to be agnostic but I don't think preserve is the best practical choice as a default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants