reactjstypescriptvisual-studio-codetsx

Make VSCode apply syntax highlighting to .tsx files


Trying to start a gatsby+react+typescript project and VSCode will only apply syntax highlighting to the HTML in my .tsx files. The typescript code remains a single color. How do I fix this?

Note: I have no plugins installed at the moment and the highlighting works if the file type is set to .jsx

related image


Solution

  • Clicking on the language button in the lower right corner and selecting typescript react fixed the problem.