DOM events

onScroll

Observes scroll changes on the element itself; React onScroll does not bubble like ordinary click handlers. Keep the handler inexpensive and avoid reading layout repeatedly.

Formal Syntax & Structure

react syntaxreact
onScroll={handler}

Working Example

Example Snippetreact
export default function App() { return <div tabIndex={0} aria-label='Tool list' style={{height:80,overflow:'auto'}} onScroll={e=>console.log(e.currentTarget.scrollTop)}><ul>{Array.from({length:20},(_,i)=><li key={i}>Tool {i+1}</li>)}</ul></div>; }
React Reference