简体   繁体   中英

React JS and sublime text incompatibily

I use sublime text to learn React.js, and a I have a problem with syntax. When there is a / on my code, all the code after the / have a different color, as if the / change the syntax of the code.

for exemple, if a write :

export default class Featured extends React.Component {
  render(){
    return (
      <h1> Featured </h1>
    );
  }
}

all the code have a correct color syntax until the , after the / in the tag, all the syntax is orange .. I don't understand, I have install jsx / babel / react plugins on my sublime text ..

Does someone could help me ?

Thank !

You'll need syntax highlighting especially built for JSX and ES6/Babel. Try this: https://github.com/babel/babel-sublime

作为替代方案,此语法https://github.com/borela/naomi涵盖了ReactJS,JSX,Flowtype和ES2017 +,其中我甚至添加了对Stage 0功能的支持。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM