Nyxynyx
Nyxynyx

Reputation: 63599

React.js Strange Syntax Highlighting in Sublime

enter image description here

While following a React.js tutorial, I notice that the syntax highlighting in Sublime Text 3 looks strange, especially after the closing </h1> tag.

Is there a way to allow Sublime Text to do proper syntax highlighting such as this?

Upvotes: 2

Views: 769

Answers (1)

jmancherje
jmancherje

Reputation: 6633

You need to install a plugin that recognizes JSX. Babel sublime is great. Once you get that installed you can set your syntax to Babel (JavaScript) instead of just JavaScript.

Here's a blog post on setting up Sublime for React.js. It shows you how to set the default syntax highlighting to babel. In the tutorial it does it for .jsx extensions, but I did it for .js and it works great for all JavaScript.

http://cheng.logdown.com/posts/2015/07/10/setup-sublime-text-3-for-reactjs-development

Upvotes: 7

Related Questions