React import from wrong directory

Viewed 324

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

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

Related