March 2018
Beginner to intermediate
344 pages
7h 7m
English
We can also pass style elements and a variety of other attributes to our rendered items. Here's an example that uses the style object to change the color of each item red:
h('div', [ h('ul', { style: { color: 'red' } }, [ h('li', 'Evan You'), h('li', 'Edd Yerburgh'), h('li', 'Paul Halliday') ]) ])
As you can imagine, we can add as many style attributes as we want, as well as extra options that we would expect, such as props, directives, on (click handlers), and so on. Let's look at how we can map over elements to render a component with props.
Read now
Unlock full access