JSFiddle - React, Tailwind, and code Playground

JavaScript

(function () {

    var CurrentHeight;

    (function CheckForOrientationChange() {

        var NewHeight = window.screen.availHeight / window.devicePixelRatio;

        if (CurrentHeight && CurrentHeight!== NewHeight ) {

            console.log(NewHeight); // change here
        }

        CurrentHeight = NewHeight;

        setTimeout(CheckForOrientationChange, 1000);

    })();

})();