UNPKG

393 BMarkdownView Raw
1## Hyperscript
2
3`r` is a helper for `document.createElement` with couple of differences.
4The basic idea is to simply create elements with `r` and mount them with `mount`, almost like you would do with plain JavaScript:
5
6```js
7import { r, mount } from 'radi';
8
9const hello = r('h1', {}, 'Hello Radi!');
10
11mount(hello, document.body);
12```
13
14```html
15<body>
16 <h1>Hello Radi!</h1>
17</body>
18```