From c031ccdc57b7a3321c1753f15b2f44053072a102 Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 7 Dec 2015 23:23:26 -0800 Subject: [PATCH] JSX style Wrote some notes on the standard JSX / XHP style --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aebef40cc..fbb114cc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,6 +67,14 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe * Do not use the optional parameters of `setTimeout` and `setInterval` * 80 character line length +#### JSX + +* Prefer `'` over `"` for string literal props +* When wrapping opening tags over multiple lines, place one prop per line +* `{}` of props should hug their values (no spaces) +* Place the closing `>` of opening tags on the same line as the last prop +* Place the closing `/>` of self-closing tags on their own line and left-align them wih the opening `<` + #### Objective-C * Space after `@property` declarations