JSFiddle - React, Tailwind, and code Playground
by joe_sky
HTML
<script src="https://unpkg.com/core-js/client/core.min.js"></script>
<script src="https://unpkg.com/react@16.2.0/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.2.0/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/nornj@0.4.2/dist/nornj.min.js"></script>
<script src="https://unpkg.com/nornj-react@0.4.2/dist/nornj-react.min.js"></script>
<section id="container">
<script type="text/nornj">
<div>
<#each {1 .. 20}>
<i class="item" style="margin-left:{this * 2}px;">Welcome to using the NornJ template engine! This is the {this} time</i><br>
</#each>
<Container />
</div>
</script>
</section>
CSS
.item {
color: purple;
}
Babel + JSX
class Container extends React.Component {
render() {
return nj`
<br>
<b>This is a nornj + react simple demo.</b>
`();
}
}
nj.registerComponent({ Container });
njr.renderTmplTag();