Reputation: 358
is there a way for autocomplete react components like JSX tags , like this code below, I want VS code to autocomplete Header, Main and Footer Components and so on
function App() {
return (
<>
<Header />
<Main />
<Footer/>
</>
);
}
Upvotes: 2
Views: 6997
Reputation: 56
The most straight-forward way to get JSX/HTML autocomplete in your React projects is to add this to your user settings or workspace settings (<project-path>/.vscode/settings.json
):
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.triggerExpansionOnTab": true
You may have to restart VS Code for the change to take effect.
Upvotes: 4