JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<div style="height: 2000px">Scroll down!</div>
JavaScript
var alerted = false;
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100) {
if (!alerted) {
alert("bottom!");
alerted = true;
}
}
else alerted = false;
});