Skip to content

Commit

Permalink
Update react/README.md
Browse files Browse the repository at this point in the history
Fix jsx syntax display issue in webpage

Fixes airbnb#2301
  • Loading branch information
rahulrk-dev committed Jul 11, 2021
1 parent f5c14ca commit 6daa866
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ This style guide is mostly based on the standards that are currently prevalent i
- Always use double quotes (`"`) for JSX attributes, but single quotes (`'`) for all other JS. eslint: [`jsx-quotes`](https://eslint.org/docs/rules/jsx-quotes)

> Why? Regular HTML attributes also typically use double quotes instead of single, so JSX attributes mirror this convention.
<!--- {% raw %} -->
```jsx
// bad
<Foo bar='bar' />
Expand All @@ -256,7 +257,8 @@ This style guide is mostly based on the standards that are currently prevalent i
// good
<Foo style={{ left: '20px' }} />
```

<!--- {% endraw %} -->

## Spacing

- Always include a single space in your self-closing tag. eslint: [`no-multi-spaces`](https://eslint.org/docs/rules/no-multi-spaces), [`react/jsx-tag-spacing`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md)
Expand Down

0 comments on commit 6daa866

Please sign in to comment.