Next, you can use it by creating your first Zino JSX component in src/:
As you can see above, the render function which normally uses the this.createNode() function to generate the DOM structure of a component can now be written in JSX, making the code more readable and providing all of the niceties of JSX. As before, the data parameter of the render function provides access to the component’s state and properties. The callbacks, state and event definitions can be added as additional methods / attributes to the class.
Note: The callback can be defined as class methods, if they are prefixed with on, for example onmount, onrender etc… . Things like the state and events can be defined as getters of the class, providing a nice shell for complex values.
In order to compile it, simply run:
The output file will be generated into the public/ directory from which it can then be included into your page.
A more complex example using JSX would look like that: