Shakil Ahmed
Shakil Ahmed

Reputation: 89

Vscode not showing html tags suggestion in react app

VScode suddenly stopped showing suggesions for html tags in react app. As you can see there is no suggestion appearing for html tags. But when I add the following lines to settings.json file, then the html tag suggestion appears but that time javascript suggestion stops appearing. Again when I remove the following lines from settings.json, I get javascript suggestions but html tag suggestions does not appears. How can I fix this?

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

enter image description here

Upvotes: 0

Views: 2430

Answers (2)

Selcukusu
Selcukusu

Reputation: 434

Install @types/react even if you are using JavaScript.

pnpm i -d @types/react

Upvotes: 0

sourabh kumawat
sourabh kumawat

Reputation: 31

To add JSX/HTML autocomplete for .js files in React projects as follows

Add this in settings.json

"emmet.includeLanguages": {
     "javascript": "javascriptreact"
 },
 "emmet.syntaxProfiles": {
     "javascript": "jsx"
 }

Upvotes: 2

Related Questions