'How to stop VS Code importing react methods from Minified React?
At some point, my VS Code has started to import react hooks from react/cjs/react.production.min, not from react.
This annoys me because it only causes errors when I'm developing on my localhost:3000 even with simple hooks such as useState, useEffect, etc.. Is there a way to configure VS Code to import React materials from 'react'? I am tired of manually fixing import statements.
The first pic is the error page I get on Next JS, and the second pic is showing how VS Code automatically imports useState from Minified React. The line above it is the ones I manually fixed.

Solution 1:[1]
maybe you can try to install the Auto Import
https://marketplace.visualstudio.com/items?itemName=steoates.autoimport
or simple reinstall your vscode maybe the fastest way to resolve it
Solution 2:[2]
Following Rivers answer "Auto Import - ES6, TS, JSX, TSX" worked for me since I don't use Typescript.
https://marketplace.visualstudio.com/items?itemName=NuclleaR.vscode-extension-auto-import
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | River |
| Solution 2 | Julius |

