From 2b45b6b02a08c664e737b02f30dd77db260abe1e Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 15 Mar 2018 22:29:14 -0500 Subject: [PATCH 1/2] Fix typos in README Just some minor doc tweaks. The raw VNode example was incorrect since `children` must be an array. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index df57a4d49..e480cc9e8 100644 --- a/README.md +++ b/README.md @@ -222,17 +222,17 @@ A virtual DOM is a description of what a DOM should look like using a tree of ne { nodeName: "h1", attributes: {}, - children: 0 + children: [0] }, { nodeName: "button", attributes: { ... }, - children: "-" + children: ["-"] }, { nodeName: "button", attributes: { ... }, - children: "+" + children: ["+"] } ] } @@ -307,7 +307,7 @@ export const view = (state, actions) => ( ) ``` -If you don't know all the attributes that you want to place in a component ahead of time, you can use the [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). Note that Hyperapp components can return multiple elements as in the following example. This technique lets you group a list of children without adding extra nodes to the DOM. +If you don't know all the attributes that you want to place in a component ahead of time, you can use the [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). Note that Hyperapp components can return an Array of elements as in the following example. This technique lets you group a list of children without adding extra nodes to the DOM. ```jsx const TodoList = ({ todos, toggle }) => @@ -345,7 +345,7 @@ export const view = (state, actions) => ( #### Children Composition -Components receive their children elements via the second argument allowing you and other components pass arbitrary children down to them. +Components receive their children elements via the second argument, allowing you and other components to pass arbitrary children down to them. ```jsx const Box = ({ color }, children) => ( From 8b6ee77c9bd3d17e483f9c3322b5071279b8449c Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 15 Mar 2018 22:43:12 -0500 Subject: [PATCH 2/2] README: Array -> array --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e480cc9e8..1ae371d4e 100644 --- a/README.md +++ b/README.md @@ -307,7 +307,7 @@ export const view = (state, actions) => ( ) ``` -If you don't know all the attributes that you want to place in a component ahead of time, you can use the [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). Note that Hyperapp components can return an Array of elements as in the following example. This technique lets you group a list of children without adding extra nodes to the DOM. +If you don't know all the attributes that you want to place in a component ahead of time, you can use the [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). Note that Hyperapp components can return an array of elements as in the following example. This technique lets you group a list of children without adding extra nodes to the DOM. ```jsx const TodoList = ({ todos, toggle }) =>