@samitouri / QOS-React-2 / commits / 17d36a4cc3
Fork 0

The library for web and native user interfaces.

Standardized Markdown lists

Paul O’Shannessy committed Jul 16, 2013 at 23:35 UTC 17d36a4cc3d16389fa1c3aba338c728524f6f456
3 files changed +30 -30
docs/docs/02.1-jsx-in-depth.md
+11 -11
@@ -22,9 +22,9 @@ var link = React.DOM.a({href: 'http://facebook.github.io/react'}, 'React');
22
23 We recommend using JSX for many reasons:
24
25 -- It's easier to visualize the structure of the DOM.
26 -- Designers are more comfortable making changes.
27 -- It's familiar for those who have used MXML or XAML.
25 +* It's easier to visualize the structure of the DOM.
26 +* Designers are more comfortable making changes.
27 +* It's familiar for those who have used MXML or XAML.
28
29
30 ## The Transform
@@ -69,8 +69,8 @@ how to setup compilation.
69 React and JSX are independent technologies, but JSX was primarily built with
70 React in mind. The two valid uses of JSX are:
71
72 -- To construct instances of React DOM components (`React.DOM.*`).
73 -- To construct instances of composite components created with
72 +* To construct instances of React DOM components (`React.DOM.*`).
73 +* To construct instances of composite components created with
74 `React.createClass()`.
75
76 ### React DOM Components
@@ -160,9 +160,9 @@ var content = <Container>{/* this is a comment */}<Nav /></Container>;
160
161 Beyond the compilation step, JSX does not require any special tools.
162
163 -- Many editors already include reasonable support for JSX (Vim, Emacs js2-mode).
164 -- Linting provides accurate line numbers after compiling without sourcemaps.
165 -- Elements use standard scoping so linters can find usage of out-of-scope
163 +* Many editors already include reasonable support for JSX (Vim, Emacs js2-mode).
164 +* Linting provides accurate line numbers after compiling without sourcemaps.
165 +* Elements use standard scoping so linters can find usage of out-of-scope
166 components.
167
168 ## Prior Work
@@ -171,8 +171,8 @@ JSX is similar to several other JavaScript embedded XML language
171 proposals/projects. Some of the features of JSX that distinguish it from similar
172 efforts include:
173
174 -- JSX is a simple syntactic transform.
175 -- JSX neither provides nor requires a runtime library.
176 -- JSX does not alter or add to the semantics of JavaScript.
174 +* JSX is a simple syntactic transform.
175 +* JSX neither provides nor requires a runtime library.
176 +* JSX does not alter or add to the semantics of JavaScript.
177
178 JSX is similar to HTML, but not exactly the same. See [JSX gotchas](./jsx-gotchas.html) for some key differences.
docs/docs/06-forms.md
+6 -6
@@ -14,17 +14,17 @@ Form components such as `<input>`, `<textarea>`, and `<option>` differ from othe
14
15 Form components support a few props that are affected via user interactions:
16
17 - - `value`, supported by `<input>` and `<textarea>` components.
18 - - `checked`, supported by `<input>` components of type `checkbox` or `radio`.
19 - - `selected`, supported by `<option>` components.
17 +* `value`, supported by `<input>` and `<textarea>` components.
18 +* `checked`, supported by `<input>` components of type `checkbox` or `radio`.
19 +* `selected`, supported by `<option>` components.
20
21 In HTML, the value of `<textarea>` is set via children. In React, you should use `value` instead.
22
23 Form components allow listening for changes by setting a callback to the `onChange` prop. The `onChange` prop works across browsers to fire in response to user interactions when:
24
25 - - The `value` of `<input>` or `<textarea>` changes.
26 - - The `checked` state of `<input>` changes.
27 - - The `selected` state of `<option>` changes.
25 +* The `value` of `<input>` or `<textarea>` changes.
26 +* The `checked` state of `<input>` changes.
27 +* The `selected` state of `<option>` changes.
28
29 Like all DOM events, the `onChange` prop is supported on all native components and can be used to listen to bubbled change events.
30
docs/docs/07-working-with-the-browser.md
+13 -13
@@ -69,39 +69,39 @@ To learn more about refs, including ways to use them effectively, see our [more
69
70 Components have three main parts of their lifecycle:
71
72 -- **Mounting:** A component is being inserted into the DOM.
73 -- **Updating:** A component is being re-rendered to determine if the DOM should be updated.
74 -- **Unmounting:** A component is being removed from the DOM.
72 +* **Mounting:** A component is being inserted into the DOM.
73 +* **Updating:** A component is being re-rendered to determine if the DOM should be updated.
74 +* **Unmounting:** A component is being removed from the DOM.
75
76 React provides lifecycle methods that you can specify to hook into this process. We provide **will** methods, which are called right before something happens, and **did** methods which are called right after something happens.
77
78
79 ### Mounting
80
81 - - `getInitialState(): object` is invoked before a component is mounted. Stateful components should implement this and return the initial state data.
82 - - `componentWillMount()` is invoked immediately before mounting occurs.
83 - - `componentDidMount(DOMElement rootNode)` is invoked immediately after mounting occurs. Initialization that requires DOM nodes should go here.
81 +* `getInitialState(): object` is invoked before a component is mounted. Stateful components should implement this and return the initial state data.
82 +* `componentWillMount()` is invoked immediately before mounting occurs.
83 +* `componentDidMount(DOMElement rootNode)` is invoked immediately after mounting occurs. Initialization that requires DOM nodes should go here.
84
85
86 ### Updating
87
88 - - `componentWillReceiveProps(object nextProps)` is invoked when a mounted component receives new props. This method should be used to compare `this.props` and `nextProps` to perform state transitions using `this.setState()`.
89 - - `shouldComponentUpdate(object nextProps, object nextState): boolean` is invoked when a component decides whether any changes warrant an update to the DOM. Implement this as an optimization to compare `this.props` with `nextProps` and `this.state` with `nextState` and return false if React should skip updating.
90 - - `componentWillUpdate(object nextProps, object nextState)` is invoked immediately before updating occurs. You cannot call `this.setState()` here.
91 - - `componentDidUpdate(object prevProps, object prevState, DOMElement rootNode)` is invoked immediately after updating occurs.
88 +* `componentWillReceiveProps(object nextProps)` is invoked when a mounted component receives new props. This method should be used to compare `this.props` and `nextProps` to perform state transitions using `this.setState()`.
89 +* `shouldComponentUpdate(object nextProps, object nextState): boolean` is invoked when a component decides whether any changes warrant an update to the DOM. Implement this as an optimization to compare `this.props` with `nextProps` and `this.state` with `nextState` and return false if React should skip updating.
90 +* `componentWillUpdate(object nextProps, object nextState)` is invoked immediately before updating occurs. You cannot call `this.setState()` here.
91 +* `componentDidUpdate(object prevProps, object prevState, DOMElement rootNode)` is invoked immediately after updating occurs.
92
93
94 ### Unmounting
95
96 - - `componentWillUnmount()` is invoked immediately before a component is unmounted and destroyed. Cleanup should go here.
96 +* `componentWillUnmount()` is invoked immediately before a component is unmounted and destroyed. Cleanup should go here.
97
98
99 ### Mounted Methods
100
101 _Mounted_ composite components also support the following methods:
102
103 - - `getDOMNode(): DOMElement` can be invoked on any mounted component in order to obtain a reference to its rendered DOM node.
104 - - `forceUpdate()` can be invoked on any mounted component when you know that some deeper aspect of the component's state has changed without using `this.setState()`.
103 +* `getDOMNode(): DOMElement` can be invoked on any mounted component in order to obtain a reference to its rendered DOM node.
104 +* `forceUpdate()` can be invoked on any mounted component when you know that some deeper aspect of the component's state has changed without using `this.setState()`.
105
106 > Note:
107 >