I am using Visual Studio Code and creating a React App. I understand that Vsc comes with Emmet but it does not work with my React App. I have tried putting the following code in settings.
"emmet.includeLanguages": {
"javascript": "javascriptreact",
"xml": {
"attr_quotes": "single"
}
},
"emmet.triggerExpansionOnTab": true,
Go to settings > extensions > emmet > include languages and add javascript as the item and javascriptreact as the value.
Easy way to enable emmet for ReactIt's already included for all HTML and CSS files by default in VS code but we need to do some extra configuration to enable it for React. 4. Once opened, add "javascript": "javascriptreact" under “ emmet. includeLanguages ” and save the file.
The "typescriptreact" option will help Emmet recognize JSX within your . tsx files if you're using React with TypeScript. Now, I like to go a step further and add another line to our settings. json file we opened up earlier.
Emmets don't work in JS files. However, you can set it so that VS Code thinks that it's a JSX file and it would give React IntelliSense.
Add this to settings JSON:
"emmet.includeLanguages": {
"javascript": "javascriptreact"
}
In case the marked answer dont work!
In VS Code open settings using command:
On PC: Ctrl + ,
On Mac: Command + ,
Be sure workspace
is selected
Search Emmet, scroll down to Emmet Include Language
and open settings.JSON
file
Paste the following code and save the file. Reload VS CODE
and it will work!:
{
"emmet.includeLanguages": {
"javascript": "javascriptreact"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With