I need to enable React related suggestions and autoplete but in files with .js
extension in Visual Studio Code. The only way to make it working for me is to change extension from .js
to .jsx
. I tried everything described in this post but nothing worked for me.
Here is what I mean by React related suggestions and autoplete.
I need to enable React related suggestions and autoplete but in files with .js
extension in Visual Studio Code. The only way to make it working for me is to change extension from .js
to .jsx
. I tried everything described in this post but nothing worked for me.
Here is what I mean by React related suggestions and autoplete.
Share Improve this question asked Jun 8, 2020 at 17:28 Mark LadyshevMark Ladyshev 411 silver badge5 bronze badges3 Answers
Reset to default 2"*.jsx"
extension assosiacted with javascriptreact
language mode.
Change the file type from javascript
to javascriptreact
, you can do it from the bottom panel.
Or run Change language Mode
from mand palette (ctrl+p
).
Also, you can add files.associtiations
on your settings.json
:
"files.associations": {
"*.react.js": "javascriptreact",
"*.jsx": "javascriptreact",
"*.js": "javascriptreact",
}
I was having an issue with React autoplete not working in my development environment. After some investigation, I found a solution that resolved the problem.
The issue was that React autoplete suggestions were not appearing as expected. I discovered that installing the @types/react package fixed the problem. Here’s the mand I used to install it:
- npm i @types/react
I am also having same problem but when I keep index.js file open in background everything just works. You can also try