Reputation: 89
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"
},
Upvotes: 0
Views: 2430
Reputation: 434
Install @types/react even if you are using JavaScript.
pnpm i -d @types/react
Upvotes: 0
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