Is there any way to use components or HTML completion in Visual Studio Code? Because typing each letter manually is not good idea when we have classes like Bootstrap etc. Fo
Just select the appropriate Language mode at the bottom-right on the screen: set it to JavaScript React.
2018
I'm using VSCode
(ver 1.27.2)
Base on my experienced, even though I'm working with React
. The detected language on my VSCode
is still vanilla JavaScript
. And emmet did not work.
VSCode
detected language to JavaScript React
. This is for single JS
file only. Click Configure File Association for .js...
And select JSX
, which in my case, I already did.
ctrl + , (comma)
to open it.Type and search for emmet
or Emmet
. Then copy the Setting you want to override.
In my case:
{
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
}
Note: I didn't try to use jsx
only javascriptreact
.
I implemented the second and third step. And I can now do Emmet
.
None of those solutions worked... but the Auto Close Tag extension does! https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-close-tag
Only work in JSX files. Let it not work with JS.
"files.associations": {
"*.js": "javascript",
"*.jsx": "javascriptreact",
},
"emmet.triggerExpansionOnTab": true,
"emmet.includeLanguages": {
"javascriptreact": "javascriptreact"
},