Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up proper React Code highlighting in Visual Studio Code?

I have been trying to find a proper way to highlight React Code in '.js' files so that it is easier to read in Visual Studio Code. The photo below shows a sample file of how a lot of it is in one color, making it hard to read.

I tried using "jsx" extension by TwentyChung and "react-beautify", but neither of them worked. Can someone please assist? :-)

enter image description here

like image 200
andre Avatar asked Jan 01 '17 21:01

andre


People also ask

How do you highlight codes in React?

You need to install prism–react–renderer from NPM to use it. Prism react renderer exposes Highlight as its main component and exports some default props, which you can pass to Highlight . You need to pass a render prop to the Highlight component as in the example below.


1 Answers

Change the VS CODE color theme to Dark+ and change the language in bottom status bar to java script react. This worked for me

like image 91
Mayur C Dhage Avatar answered Oct 19 '22 01:10

Mayur C Dhage