JSFiddle - React, Tailwind, and code Playground

by mr_olafsson

HTML

<script src="http://tempojs.com/tempo2.min.js"></script>
<ul id="template">
    <li data-template>
        {{text}}
        <ul>
            <li data-template-for="children">
                {{text}}
                <ul>
                    <li data-template-for="children">{{text}}</li>
                </ul>
            </li>
        </ul>
    </li>
</ul>

JavaScript

var data = [
    {
    "text": "The sun is shining",
    "children": []},
{
    "text": "it is cloudy.",
    "children": [
        {
        "text": "It is raining.",
        "children": []},
    {
        "text": "The sun was shining.",
        "children": []},
    {
        "text": "A rainbow appeared.",
        "children": [
            {
            "text": "A pot of gold was found at the end of the rainbow.",
            "children": []},
        {
            "text": "The gold returned more than a million dollars, when sold.",
            "children": []}
        ]}
    ]}
];

Tempo.prepare("template").render(data);