Skip to content

Commit 65f777b

Browse files
committed
Merge branch 'master' of https://github.com/hyperapp/hyperapp
2 parents 6aac304 + 1a92619 commit 65f777b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,17 @@ A virtual DOM is a description of what a DOM should look like using a tree of ne
222222
{
223223
nodeName: "h1",
224224
attributes: {},
225-
children: 0
225+
children: [0]
226226
},
227227
{
228228
nodeName: "button",
229229
attributes: { ... },
230-
children: "-"
230+
children: ["-"]
231231
},
232232
{
233233
nodeName: "button",
234234
attributes: { ... },
235-
children: "+"
235+
children: ["+"]
236236
}
237237
]
238238
}
@@ -307,7 +307,7 @@ export const view = (state, actions) => (
307307
)
308308
```
309309

310-
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.
310+
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.
311311

312312
```jsx
313313
const TodoList = ({ todos, toggle }) =>
@@ -318,6 +318,8 @@ const TodoList = ({ todos, toggle }) =>
318318

319319
Components can only receive attributes and children from their parent component. Similarly to the top-level view function, lazy components are passed your application global state and actions. To create a lazy component, return a view function from a regular component.
320320

321+
Available from version 1.2
322+
321323
```jsx
322324
import { h } from "hyperapp"
323325

@@ -345,7 +347,7 @@ export const view = (state, actions) => (
345347

346348
#### Children Composition
347349

348-
Components receive their children elements via the second argument allowing you and other components pass arbitrary children down to them.
350+
Components receive their children elements via the second argument, allowing you and other components to pass arbitrary children down to them.
349351

350352
```jsx
351353
const Box = ({ color }, children) => (
@@ -366,7 +368,7 @@ Supported attributes include [HTML attributes](https://developer.mozilla.org/en-
366368
### Styles
367369

368370
The <samp>style</samp> attribute expects a plain object rather than a string as in HTML.
369-
Each declaration consists of a style name property written in <samp>camelCase</samp> and a value. CSS variables are currently not supported. See [#612](https://github.com/hyperapp/hyperapp/pull/612) for options.
371+
Each declaration consists of a style name property written in <samp>camelCase</samp> and a value. CSS variables are supported too.
370372

371373
Individual style properties will be diffed and mapped against <samp>[HTMLElement.style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style)</samp> property members of the DOM element - you should therefore use the JavaScript style object [property names](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Properties_Reference), e.g. <samp>backgroundColor</samp> rather than <samp>background-color</samp>.
372374

0 commit comments

Comments
 (0)