JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test"></div>

CSS

#test{
    height:2000px;
}

JavaScript

$(window).scroll(function () { 
   if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) {
      alert('end of page');
   }
});