From 1cd0ec0cd242376c2cf8290a77ca53a6e019341f Mon Sep 17 00:00:00 2001 From: Pat Cavit Date: Mon, 12 Sep 2016 10:35:08 -0700 Subject: [PATCH] m.component removal --- docs/v1.x-migration.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/v1.x-migration.md b/docs/v1.x-migration.md index f2e03967..2ced0f0a 100644 --- a/docs/v1.x-migration.md +++ b/docs/v1.x-migration.md @@ -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.