Jelena Ajdukovic
Jelena Ajdukovic

Reputation: 351

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

Upvotes: 3

Views: 929

Answers (1)

cccjaccck
cccjaccck

Reputation: 46

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

Upvotes: 3

Related Questions