5

What is the standard style for jsx? Specifically when HTML is intertwined with js. Are the parenthesis after return in the correct spot? Anyone know of any good formatters that don't mess everything up?

render: function(){ return ( <li> <input id={this.props.id} type="checkbox" /> <label htmlFor={this.props.id}>{this.props.tag}</label> </li> ); } 
0

2 Answers 2

6

I like to use Airbnb code style with Web Storm Editor provide good support for jsx syntax.

Note: you can apply Airbnb style automatically inside Web Storm from Settings->Code Quality


render() { return ( <MyComponent className="long body" foo="bar"> <MyChild /> </MyComponent> ); } 
Sign up to request clarification or add additional context in comments.

Comments

2

Found a good style guide here https://github.com/airbnb/javascript/blob/master/react/README.md

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.