Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React import from wrong directory

When I click on useState, I get wrong import:

import { useState } from "react/cjs/react.development";

I need to click and get:

import { useState } from "react";

Import is wrong

How to change this?

package.json enter image description here

like image 293
Jelena Ajdukovic Avatar asked Dec 18 '25 23:12

Jelena Ajdukovic


1 Answers

I faced same problem. It suddenly happened few days ago to me, don't know what exactly gone wrong with my project.

But, I found temporary solution and using it.

install @types/react into your project.

solution from: https://github.com/microsoft/vscode/issues/141385

like image 87
cccjaccck Avatar answered Dec 20 '25 16:12

cccjaccck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!