syntax highlighting for react code in sublime

Solution 1:

Installing babel fixes the syntax highlighting.

Steps to install babel on sublime3:

  1. For windows: Press Ctrl+Shift+P For mac: Cmd+Shift+P
  2. Then type install and select Package control: Install Package
  3. Then type Babel and select 'Babel-Snippets'. It will install babel in few moments.
  4. 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:

enter image description here

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