28

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,
AltBrian
  • 2,392
  • 9
  • 29
  • 58

7 Answers7

70

Add this to settings JSON:

"emmet.includeLanguages": {
  "javascript": "javascriptreact"
}
Damjan Pavlica
  • 31,277
  • 10
  • 71
  • 76
  • 2
    I also had to add `"emmet.showSuggestionsAsSnippets": true` or I found adding emmet siblings with the + character did not work properly. – Darren Evans Jun 03 '21 at 16:26
34

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

enter image description here

Search Emmet, scroll down to Emmet Include Language and open settings.JSON file

enter image description here

Paste the following code and save the file. Reload VS CODE and it will work!:

{
  "emmet.includeLanguages": {
   
    "javascript": "javascriptreact"
  }
}

Updated 2022

Add item and and its value like this:

enter image description here enter image description here

Fareed Khan
  • 2,613
  • 1
  • 11
  • 19
7

On PC: Ctrl + ,

On Mac: Command + ,

Make Sure you have added item and value like shown in screenshot below -

enter image description here

mufaddal_mw
  • 351
  • 2
  • 11
5

install Extension Emmet

go to setting.json then add this:

"emmet.includeLanguages": {
"javascript": "javascriptreact",
}
Mhammed Talhaouy
  • 1,129
  • 10
  • 14
4

Go into your settings.json file and inside the "configuration" object paste this:

"emmet.includeLanguages": {
"javascript": "javascriptreact",
}
mhhabib
  • 2,975
  • 1
  • 15
  • 29
3
{
  "emmet.excludeLanguages": ["markdown"],

  "emmet.includeLanguages": {

    "javascript": "javascriptreact"

  }
}

Add this to your JSON.

4b0
  • 21,981
  • 30
  • 95
  • 142
vikky singh
  • 356
  • 3
  • 6
0

Go to setting or press Ctrl + , then setting.json then add this:

"emmet.includeLanguages": {
    "javascript": "javascriptreact",
    "typescript": "typescriptreact"
},
Mushfiqur Rahman
  • 376
  • 1
  • 2
  • 15