JSFiddle - React, Tailwind, and code Playground

JavaScript

var docLoaded = setInterval(function () {
    if(document.readyState !== "complete") return;
    clearInterval(docLoaded);
    
    // your code goes here i.e. init();
    alert('Document loaded');
}, 100);