Get started
Hyperscript/JSX
Hyperscript
// v(tagName, properties[, childnodes])
return v('div', {id: 'valyrian'}, [
'An awesome framework',
v('small', null, 'It will surprise you')
]);
The latest code will create the next view<div id="valyrian">
An awesome framework <small>It will surprise yousmall>
div>
An awesome framework It will surprise you
JSX
This way you can create the previous dom the way it is finally represented:
// You write
return <div id="valyrian">
An awesome framework <small>It will surprise yousmall>
div>;
// And you get
<div id="valyrian">
An awesome framework <small>It will surprise yousmall>
div>
An awesome framework It will surprise you
Babel
Then in your
.babelrc
file:{
"presets": ["..."],
"plugins": [
["transform-react-jsx", {
"pragma": "v"
}]
]
}
Buble
jsx: 'v'
in the configuration object:{
input: '...',
plugins: [
buble({
jsx: 'v'
})
]
}
Multiple root elements
return [
<span>Hellospan>,
<span>Worldspan>
];