DEV Community

Kehinde Adeleke
Kehinde Adeleke

Posted on

4 2

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay