JSX or HTML autocompletion in Visual Studio Code

2022: Straightforward way to add JSX/HTML autocomplete for .js files in React projects…

First, open VSCode’s settings.json. To open settings.json, press Ctrl + , (or Cmd+, on Mac), then click the Open JSON button shown below. Optionally, if you don’t want to set this globally, you can create a .vscode/settings.json file at the project root.

Button for settings.json file

Next, add these JSON values in the settings.json:

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

Leave a Comment