Hesham Adel
Hesham Adel

Reputation: 367

syntax highlighting for JSX not working in sublime text 3

I am using sublime text for react.js development and everything is fine but the syntax highlighting for the inline code inside html files as shown in line number 18.

enter image description here

note that syntax highlighting works fine within example.js that was wired up in line number 16

Upvotes: 4

Views: 3926

Answers (2)

Eric Conner
Eric Conner

Reputation: 10752

You need to select Javascript (Babel) for the language in the bottom right corner:

enter image description here

Upvotes: 15

Shubham Khatri
Shubham Khatri

Reputation: 281626

It doesn't work because in sublime your syntax highlighting is set to HTML. See bottom right corner in you sublime. In your js file it would have been set to jsx and that's why it worked correctly there. This answer on Stackoverflow explains how you can achieve it in Sublime Text 2.

You can also visit and look at Sublime text 3 documentation for syntax here

I suppose these will help you and I could explain the problem to you.

Upvotes: 6

Related Questions