JSFiddle - React, Tailwind, and code Playground

HTML

<input type=text/>

JavaScript

$(document).ready(function(e){
    $("body").append("<div id='js-viewport-debug' style='position: fixed; top: 0; left: 0; padding: .5em 1em; background: rgba(0,0,0,.6); color: #eee;'>" + $(window).width() + ", " + $(window).height() + "</div>");
    $(window).resize(function(e){
        $("#js-viewport-debug").text( $(window).width() + ", " + $(window).height() );
     });
});