DEV Community

Kehinde Adeleke
Kehinde Adeleke

Posted on

How to add Emmet autocomplete for .js files in React

I recently ran into a problem where Emmet autocomplete would work for files ending with the .jsx extension but break break for files with the .js extension.

To solve it, do the following

  1. Click on the settings icon on the bottom left corner.
    vscode settings icon

  2. Click on the document icon to access the settings json file
    vscode settingsjson icon

  3. Add the following lines to the end of the settings.json file

"emmet.includeLanguages": {
    "javascript": "javascriptreact"
  },
  "emmet.triggerExpansionOnTab": true
Enter fullscreen mode Exit fullscreen mode

and voila, Your autocomplete should work as expected.

emmet autocomplete gif

Discussion (0)