From 2289061f90e75c9373fa4dd250691990fb44c994 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Fri, 3 Jun 2016 16:53:24 -0400 Subject: [PATCH] fix doc --- docs/mithril.component.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mithril.component.md b/docs/mithril.component.md index bd7c1ec3..72c6d3b2 100644 --- a/docs/mithril.component.md +++ b/docs/mithril.component.md @@ -388,10 +388,10 @@ var people = [ ] //ajax and display a list of projects for John -m.render(document.body, ProjectList({key: people[0].id, value: people[0]}) +m.render(document.body, m(ProjectList, {key: people[0].id, value: people[0]})) //ajax and display a list of projects for Mary -m.render(document.body, ProjectList({key: people[1].id, value: people[1]}) +m.render(document.body, m(ProjectList, {key: people[1].id, value: people[1]})) ``` In the example above, since the key is different, the ProjectList component is recreated from scratch. As a result, the controller runs again, the DOM is re-generated, and any applicable 3rd party plugins in configs are re-initialized.