Skip to content

Commit 228b601

Browse files
committed
Arrange sections for the document working-with-react
1 parent 5407598 commit 228b601

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

docs/working-with-react.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,26 @@ let MyElement = Cycle.component('MyElement', function definition() {
3838
interactions.get('OnTickEvent'); // Observable<T>
3939
```
4040

41+
## this
42+
43+
The third parameter of `definitionFn` is `self`, which represents `this` of
44+
your created React class.
45+
46+
Normally, you don't want to use this. However, it might be required for
47+
working with some React components.
48+
49+
Example:
50+
51+
```js
52+
let Navigation = require('react-router').Navigation;
53+
let options = {
54+
mixins: [Navigation]
55+
};
56+
let MyElement = Cycle.component('MyElement', function (_1, _2, self) {
57+
return Rx.Observable.just(<div onClick={() => self.goBack()}>Go back</div>);
58+
}, options);
59+
```
60+
4161
## Lifecycle events
4262

4363
You can query your component's
@@ -95,26 +115,6 @@ let MyElement = Cycle.component('MyElement', function () {
95115
}, options);
96116
```
97117

98-
## this
99-
100-
The third parameter of `definitionFn` is `self`, which represents `this` of
101-
your created React class.
102-
103-
Normally, you don't want to use this. However, it might be required for
104-
working with some React components.
105-
106-
Example:
107-
108-
```js
109-
let Navigation = require('react-router').Navigation;
110-
let options = {
111-
mixins: [Navigation]
112-
};
113-
let MyElement = Cycle.component('MyElement', function (_1, _2, self) {
114-
return Rx.Observable.just(<div onClick={() => self.goBack()}>Go back</div>);
115-
}, options);
116-
```
117-
118118
## react-hot-loader
119119

120120
Cycle-React supports

0 commit comments

Comments
 (0)