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.
note that syntax highlighting works fine within example.js that was wired up in line number 16
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.
note that syntax highlighting works fine within example.js that was wired up in line number 16
Share Improve this question edited Jul 17, 2016 at 21:41 Hesham Adel asked Jul 17, 2016 at 21:35 Hesham AdelHesham Adel 3676 silver badges16 bronze badges 1 |2 Answers
Reset to default 15You need to select Javascript (Babel) for the language in the bottom right corner:
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.
HTML
. See bottom right corner in you sublime. In your js file it would have been set tojsx
and that's why it worked correctly there. – Shubham Khatri Commented Jul 18, 2016 at 6:16