admin管理员组文章数量:1387311
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
本文标签:
版权声明:本文标题:javascript - React suggestions and autocomplete does not work for files with js extension in VSCode - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744567228a2613124.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论