JSFiddle - React, Tailwind, and code Playground
HTML
<div id="result"></div>
JavaScript
$(function() {
var maxCount = 2,
counter = 0;
setInterval(function() {
$('#result').html((counter++ % (maxCount + 1)));
}, 1000);
});