Skip to content

Commit d4f69ef

Browse files
committed
Add reasoning for using double quotes in JSX
1 parent f823047 commit d4f69ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

react/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@
117117

118118
## Quotes
119119
- Always use double quotes (`"`) for JSX attributes, but single quotes for all other JS.
120+
121+
> 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.
122+
120123
```javascript
121124
// bad
122125
<Foo bar='bar' />

0 commit comments

Comments
 (0)