Reputation: 869
I'm having a go at React and I'm using Visual Studio Code IDE. The problem I'm having is that it's throwing highlighting errors when returning HTML elements in the render method. I've attached a picture to illustrate. I'm aware of the jsconfig.json
file but I don't know what I should add to hide these highlighting warnings.
Upvotes: 1
Views: 1318
Reputation: 3887
React files need a jsx
extension for VS Code to highlight them correctly.
I attached screenshots to show. The first one is with js
extension. This looks comparable to your screenshot.
Note that with the second I renamed the file to .jsx
and the highlighting is correct
Upvotes: 2