Skip to content

Incorrect automatic import path for React in JavaScript projects #146297

@gpoole

Description

@gpoole

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66.0-insider (Universal)
  • OS Version: macOS 12.2.1 (21D62)

Steps to Reproduce:

  1. Create a new Next.js project using npx create-next-app@latest (which is using React 17.0.2)
  2. Open the project and type a React function such as useState

The suggestions all point to react/cjs/react.production.min, react/cjs/react.production or react/cjs/react.development.

Same problem as microsoft/TypeScript#47601 but this is a JavaScript project, not a TypeScript project.

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)javascriptJavaScript support issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions