Render JSX/Hyperscript to HTML strings, without VDOM 🌈
classname
and htmlFor
props (#5, thanks @nathancahill)dangerouslySetInnerHTML
(#12, thanks @pl12133)(originally published December 2016)
const Box = ({ title, children }) => (
<div class="box">
<h4>{title}</h4>
{children}
</div>
);
console.log(
<div>
<Box title="foo">
Hello, I am <strong>foo</strong>.
</Box>
<Box title="bar">
Hi! I am <strong>bar</strong>!
</Box>
</div>
);
This logs:
<div>
<div class="box">
<h4>foo</h4>
Hello, I am <strong>foo</strong>.
</div>
<div class="box">
<h4>bar</h4>
Hi! I am <strong>bar</strong>!
</div>
</div>