Skip to content

Commit

Permalink
Arrange sections for the document working-with-react
Browse files Browse the repository at this point in the history
  • Loading branch information
pH200 committed Dec 10, 2015
1 parent 5407598 commit 228b601
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions docs/working-with-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ let MyElement = Cycle.component('MyElement', function definition() {
interactions.get('OnTickEvent'); // Observable<T>
```

## this

The third parameter of `definitionFn` is `self`, which represents `this` of
your created React class.

Normally, you don't want to use this. However, it might be required for
working with some React components.

Example:

```js
let Navigation = require('react-router').Navigation;
let options = {
mixins: [Navigation]
};
let MyElement = Cycle.component('MyElement', function (_1, _2, self) {
return Rx.Observable.just(<div onClick={() => self.goBack()}>Go back</div>);
}, options);
```

## Lifecycle events

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

## this

The third parameter of `definitionFn` is `self`, which represents `this` of
your created React class.

Normally, you don't want to use this. However, it might be required for
working with some React components.

Example:

```js
let Navigation = require('react-router').Navigation;
let options = {
mixins: [Navigation]
};
let MyElement = Cycle.component('MyElement', function (_1, _2, self) {
return Rx.Observable.just(<div onClick={() => self.goBack()}>Go back</div>);
}, options);
```

## react-hot-loader

Cycle-React supports
Expand Down

0 comments on commit 228b601

Please # to comment.