You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the template has multiple element at the root level
114
+
the output is an array of `h` results:
115
+
116
+
```js
117
+
console.log(html`
118
+
<h1id=hello>Hello</h1>
119
+
<divclass=world>World!</div>
120
+
`);
121
+
// [
122
+
// {
123
+
// type: 'h1',
124
+
// props: { id: 'hello' },
125
+
// children: ['Hello']
126
+
// },
127
+
// {
128
+
// type: 'div',
129
+
// props: { class: 'world' },
130
+
// children: ['world!']
131
+
// }
132
+
// ]
133
+
```
134
+
110
135
## Example
111
136
112
137
Curious to see what it all looks like? Here's a working app!
@@ -140,7 +165,7 @@ It's a single HTML file, and there's no build or tooling. You can edit it with n
140
165
`;
141
166
}
142
167
}
143
-
168
+
144
169
constHeader= ({ name }) =>html`<h1>${name} List</h1>`
145
170
146
171
constFooter=props=>html`<footer...${props} />`
@@ -213,7 +238,7 @@ The original goal for `htm` was to create a wrapper around Preact that felt natu
213
238
214
239
This meant giving up JSX, and the closest alternative was [Tagged Templates]. So, I wrote this library to patch up the differences between the two as much as possible. As it turns out, the technique is framework-agnostic, so it should work great with most Virtual DOM libraries.
215
240
216
-
As of 2.0.0, `htm` is stable, well-tested and ready for production use.
241
+
As of 2.1.0, `htm` is stable, well-tested and ready for production use.
0 commit comments