How to Add React Syntax in Sublime

Rana Hasnain Khan Feb 15, 2024
How to Add React Syntax in Sublime

We will introduce how to use the React syntax in Sublime Text.

React Syntax in Sublime Text

Syntax highlighting is a strategy to improve the readability and context of the code. It is a great help for programmers who have to read all code to debug errors in the code.

Sublime Text is a good text editor used widely among developers because it is free and lightweight. Many developers face syntax highlighting issues especially react developers.

There is a very easy way to solve this problem.

If you are on windows, press Cntrl + Shift + P, or if you are on a mac, press cmd + Shift + P. That will open this window.

cntrl shift p result

Now, in that window, type install, and from options, select Package Control: Install Package.

install package in sublime text

Another window will open, and in that window, write Babel, and select Babel Snippets from options. It will be installed in a few minutes.

Go to View > Syntax > Javascript (Babel) and it will activate the syntax highlight.

activating syntax in sublime

And your react files will look like below.

syntax highlight in sublime

Rana Hasnain Khan avatar Rana Hasnain Khan avatar

Rana is a computer science graduate passionate about helping people to build and diagnose scalable web application problems and problems developers face across the full-stack.

LinkedIn

Related Article - React Syntax