JSFiddle - React, Tailwind, and code Playground

JavaScript

window.addEventListener('scroll', function (e) { console.log('Got window scroll event') });
document.body.addEventListener('scroll', function (e) { console.log('Got element scroll event') });

window.dispatchEvent(new Event('scroll'));
document.body.dispatchEvent(new Event('scroll'));