mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 02:28:20 -05:00
Merge pull request #534 from cooperka/react-quote-reasoning
Add reasoning for using double quotes in JSX
This commit is contained in:
@@ -117,6 +117,10 @@
|
||||
|
||||
## 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.
|
||||
> Regular HTML attributes also typically use double quotes instead of single, so JSX attributes mirror this convention.
|
||||
|
||||
```javascript
|
||||
// bad
|
||||
<Foo bar='bar' />
|
||||
|
||||
Reference in New Issue
Block a user