const scrollToTop = () => { document.getElementById("scroller").scroll(0,0) } <button onClick={scrollToTop}>Scroll to Top</button>