You must be a Member to view code

Instructor: 00:00 Hyperapp uses H-functions in order to create virtual DOM nodes. For example, if we wanted to make a div and an H1, this is how we would do it.

00:09 If we save this, our DOM renders the div and an H1. However, this can be quite cumbersome and tedious to use, if you're making more complex components in this. Luckily, we can add jsx to a hyperapp pretty easily.

00:27 The first thing I want to do is, go to your terminal and type in either npm install, or you want to add babel-plugin-transform-react-jsx and save it to your dev dependencies.

00:40 What this will do is it would allow us to transform our jsx into our H-calls. The second step is, we'll need to instruct babel to transpile our core correctly, and we do this by initiating the plugin.

00:54 We'll write a plugin's. We'll have an array, and this will actually need to be in array as well, because of it will have multiple arguments. The first one is transform-react-jsx, and the second one is an object. We'll set a key of pragma to H.

01:14 This is what tells a babel to use our H-functions where it finds jsx. Then, we can go back to our component and we can replace it with much more familiar mark up from jsx. We save it and we refresh the page. We should see a div and an H1.