Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using emmet with a react app in vs code is not working

In VS Code React emmet is not working even though I have this setting in my settings.json file

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

Does anyone have the same problem? Any solution would be perfect.

like image 236
needhelponmath Avatar asked Mar 10 '26 18:03

needhelponmath


2 Answers

Saw this from a previous thread and it worked for me, but use emmet autocomplete on a normal HTML file (index.HTML) and it should work for your JSX too.

like image 138
rakib7 Avatar answered Mar 12 '26 08:03

rakib7


As linked to the github issue by Mark, this is relatively new and not related to other common "Emmet not working" posts. Apparently it's rooted in an unexpected delay with Emmet recognizing filetypes in a workspace. Manually expanding in an HTML file seems to kicks it back into gear.

For me though, even that wasn't working. I had no issues a week ago but now Emmet was unresponsive regardless of filetype.

I followed a suggestion in the same github thread to also add

 "emmet.triggerExpansionOnTab": true,

And that seemed to work. Remember to close all open VS code windows. I had a second window open which I think was also preventing the new setting from applying.

like image 41
Chase Avatar answered Mar 12 '26 07:03

Chase



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!