Skip to content

Commit 450e64c

Browse files
committed
[readme] Add backticks around code items in react readme
I noticed a number of places in this document where code was being referenced but it was not marked as such. Adding backticks will instruct the markdown parser to format these bits as code, which should improve the readability of this document.
1 parent 055aa14 commit 450e64c

1 file changed

Lines changed: 44 additions & 44 deletions

File tree

‎react/README.md‎

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
- Always use JSX syntax.
2424
- Do not use `React.createElement` unless you're initializing the app from a file that is not JSX.
2525

26-
## Class vs React.createClass
26+
## Class vs `React.createClass`
2727

28-
- Use class extends React.Component unless you have a very good reason to use mixins.
28+
- Use `class extends React.Component` unless you have a very good reason to use mixins.
2929

3030
eslint rules: [`react/prefer-es6-class`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md).
3131

@@ -81,7 +81,7 @@
8181

8282

8383
## Declaration
84-
- Do not use displayName for naming components. Instead, name the component by reference.
84+
- Do not use `displayName` for naming components. Instead, name the component by reference.
8585

8686
```javascript
8787
// bad
@@ -261,24 +261,24 @@
261261
262262
## Ordering
263263
264-
- Ordering for class extends React.Component:
265-
266-
1. constructor
267-
1. optional static methods
268-
1. getChildContext
269-
1. componentWillMount
270-
1. componentDidMount
271-
1. componentWillReceiveProps
272-
1. shouldComponentUpdate
273-
1. componentWillUpdate
274-
1. componentDidUpdate
275-
1. componentWillUnmount
276-
1. *clickHandlers or eventHandlers* like onClickSubmit() or onChangeDescription()
277-
1. *getter methods for render* like getSelectReason() or getFooterContent()
278-
1. *Optional render methods* like renderNavigation() or renderProfilePicture()
279-
1. render
280-
281-
- How to define propTypes, defaultProps, contextTypes, etc...
264+
- Ordering for `class extends React.Component`:
265+
266+
1. `constructor`
267+
1. optional `static` methods
268+
1. `getChildContext`
269+
1. `componentWillMount`
270+
1. `componentDidMount`
271+
1. `componentWillReceiveProps`
272+
1. `shouldComponentUpdate`
273+
1. `componentWillUpdate`
274+
1. `componentDidUpdate`
275+
1. `componentWillUnmount`
276+
1. *clickHandlers or eventHandlers* like `onClickSubmit()` or `onChangeDescription()`
277+
1. *getter methods for `render`* like `getSelectReason() or `getFooterContent()`
278+
1. *Optional render methods* like `renderNavigation()` or `renderProfilePicture()`
279+
1. `render`
280+
281+
- How to define `propTypes`, `defaultProps`, `contextTypes`, etc...
282282
283283
```javascript
284284
import React, { PropTypes } from 'react';
@@ -309,29 +309,29 @@
309309
export default Link;
310310
```
311311
312-
- Ordering for React.createClass:
313-
314-
1. displayName
315-
1. propTypes
316-
1. contextTypes
317-
1. childContextTypes
318-
1. mixins
319-
1. statics
320-
1. defaultProps
321-
1. getDefaultProps
322-
1. getInitialState
323-
1. getChildContext
324-
1. componentWillMount
325-
1. componentDidMount
326-
1. componentWillReceiveProps
327-
1. shouldComponentUpdate
328-
1. componentWillUpdate
329-
1. componentDidUpdate
330-
1. componentWillUnmount
331-
1. *clickHandlers or eventHandlers* like onClickSubmit() or onChangeDescription()
332-
1. *getter methods for render* like getSelectReason() or getFooterContent()
333-
1. *Optional render methods* like renderNavigation() or renderProfilePicture()
334-
1. render
312+
- Ordering for `React.createClass`:
313+
314+
1. `displayName`
315+
1. `propTypes`
316+
1. `contextTypes`
317+
1. `childContextTypes`
318+
1. `mixins`
319+
1. `statics`
320+
1. `defaultProps`
321+
1. `getDefaultProps`
322+
1. `getInitialState`
323+
1. `getChildContext`
324+
1. `componentWillMount`
325+
1. `componentDidMount`
326+
1. `componentWillReceiveProps`
327+
1. `shouldComponentUpdate`
328+
1. `componentWillUpdate`
329+
1. `componentDidUpdate`
330+
1. `componentWillUnmount`
331+
1. *clickHandlers or eventHandlers* like `onClickSubmit()` or `onChangeDescription()`
332+
1. *getter methods for `render`* like `getSelectReason()` or `getFooterContent()`
333+
1. *Optional render methods* like `renderNavigation()` or `renderProfilePicture()`
334+
1. `render`
335335
336336
eslint rules: [`react/sort-comp`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md).
337337

0 commit comments

Comments
 (0)