Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Havunen committed Jan 7, 2017
2 parents a3a0332 + 1845306 commit e979b58
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ This enables `findDOMNode()`. We strongly recommend against using this API as it

This enables DOM node recycling within Inferno, so that DOM nodes are re-used upon diposal. It can have significant performance benefits, but may also cause side-effects with custom elements.

## Functional component hooks
## Functional component lifeycle events

| Name | Triggered when | Arguments to callback |
| ----------- | -------------- | ----------------------- |
Expand All @@ -451,10 +451,9 @@ This enables DOM node recycling within Inferno, so that DOM nodes are re-used up
| `onComponentDidUpdate` | a functional component has performed an updated | `lastProps, nextProps` |
| `onComponentWillUnmount` | a functional component is about to be unmounted | |

### Using hooks
### Using functional lifecycle events

It's simple to implicitly assign hooks to both DOM nodes and functional components.
Please note: class components (ES2015 classes) from `inferno-component` **do not** support hooks.
Functional lifecycle events must be explicitly assigned via props onto a functional component like shown below:

```javascript
function mounted(domNode) {
Expand All @@ -468,7 +467,7 @@ function FunctionalComponent({ props }) {
Inferno.render(<FunctionalComponent onComponentDidMount={ mounted } />, document.body);
```

Hooks provide powerful lifecycle events to functional components, allowing you to build components without being forced to use ES2015 classes.
Please note: class components (ES2015 classes) from `inferno-component` **do not** support the same lifecycle events (they have their own lifecycle events that work as methods on the class itself).

## Development vs Production modes

Expand Down Expand Up @@ -521,6 +520,7 @@ Inferno supports IE11+, Edge, Chrome, Firefox and Safari 8+. In order to support

- [Promise object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
- [Map object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
- [WeakMap object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap)
- [Object.keys](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/keys)
- [Object.assign](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)

Expand Down

0 comments on commit e979b58

Please sign in to comment.