From d4f69efeecc81b1d7a99725d6c6c8e4f494dd738 Mon Sep 17 00:00:00 2001 From: Kevin Cooper Date: Thu, 1 Oct 2015 14:56:39 -0700 Subject: [PATCH 1/2] Add reasoning for using double quotes in JSX --- react/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/react/README.md b/react/README.md index d1ce8c73da..b261d8cd89 100644 --- a/react/README.md +++ b/react/README.md @@ -117,6 +117,9 @@ ## Quotes - Always use double quotes (`"`) for JSX attributes, but single quotes for all other JS. + + > Why? JSX attributes [can't contain escaped quotes](http://eslint.org/docs/rules/jsx-quotes), so double quotes make conjunctions like `"don't"` easier to type. + ```javascript // bad From ef7fbea3d94bc01907aedf26c686d00383d2201a Mon Sep 17 00:00:00 2001 From: Kevin Cooper Date: Thu, 1 Oct 2015 16:53:49 -0700 Subject: [PATCH 2/2] Add further reasoning for using double quotes in JSX --- react/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/react/README.md b/react/README.md index b261d8cd89..dd5592f4ed 100644 --- a/react/README.md +++ b/react/README.md @@ -119,6 +119,7 @@ - Always use double quotes (`"`) for JSX attributes, but single quotes for all other JS. > Why? JSX attributes [can't contain escaped quotes](http://eslint.org/docs/rules/jsx-quotes), so double quotes make conjunctions like `"don't"` easier to type. + > Regular HTML attributes also typically use double quotes instead of single, so JSX attributes mirror this convention. ```javascript // bad