m.component removal

This commit is contained in:
Pat Cavit 2016-09-12 10:35:08 -07:00 committed by GitHub
parent ea4bb1bef4
commit 1cd0ec0cd2

View file

@ -2,6 +2,7 @@
`v1.x` is largely API-compatible with `v0.2.x`, but there are a few breaking changes.
- [`m.component` removed](#mcomponent-removed)
- [`config` function](#config-function)
- [Cancelling redraw from event handlers](#cancelling-redraw-from-event-handlers)
- [Component `controller` function](#component-controller-function)
@ -15,6 +16,24 @@
- [Setting route prefix](#setting-route-prefix)
- [m.request](#mrequest)
## `m.component` removed
In `v0.2.x` components could be created using either `m(component)` or `m.component(component)`. `v1.x` only supports `m(component)`.
### `v0.2.x`
```js
// These are equivalent
m.component(component);
m(component);
```
### `v1.x`
```js
m(component);
```
## `config` function
In `v0.2.x` mithril provided a single lifecycle method, `config`. `v1.x` provides much more fine-grained control over the lifecycle of a vnode.