'VS Code + React + JSX + Components props intellisense is not working

I have a project using .JS and it works perfectly for React Components, but with my other project that I'm using JSX as file extension, it's not working.

I found some similar issues, but I couldn't fix it doing what I supposed to do and I'm still with the problem.

When I press F12 to go to the definition of the component, I get this message:

enter image description here

And when I start to write a prop, the intellisense doesn't show the prop definition. Not even the prop name. And it works with .JS files like this:

enter image description here



Solution 1:[1]

For some reason react types choose when they want to be installed

Run

npm install @types/react

And you should be fine

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 Michael Essiet