Which indentation style you prefer for JSX code?
One liners
3%
Line per attribute, regular indent
16%
Line per attribute, aligned
8%
Multiline
74%
38 votes · Closed
There are a couple of ways to indent JSX code. Which style you find to be the best:
One liners
return <div className="well" style={{ border: "1px solid orange", padding: "2rem" }}> Content </div>
Line per attribute, regular indent
return <div className="well" style={{ border: "1px solid orange", padding: "2rem" }}> Content </div>
Line per attribute, aligned
return <div className="well" style={{ border: "1px solid orange", padding: "2rem" }}> Content </div>
Multiline
return ( <div className="well" style={{ border: "1px solid orange", padding: "2rem" }} > Content </div> )