syntax highlighting for react code in sublime
Solution 1:
Installing babel fixes the syntax highlighting.
Steps to install babel on sublime3:
- For windows: Press Ctrl+Shift+P For mac: Cmd+Shift+P
- Then type
install
and selectPackage control: Install Package
- Then type
Babel
and select'Babel-Snippets'
. It will install babel in few moments.
- Then set the Babel syntax in Sublime3 Editor from:
View > Syntax > Babel > Javascript
For some users, Babel
was missing in step 4. They can additionally install Babel
by following the same steps and selecting Babel
this time instead of Babel-Snippets
in step3.
Check I tested it:
Solution 2:
You need to install babel-sublime
plugin.
You can install it from package control
of sublime.
Here is the link - https://github.com/babel/babel-sublime