MCPcopy
hub / github.com/pmndrs/react-spring / onScroll

Function onScroll

packages/parallax/src/index.tsx:303–314  ·  view source on GitHub ↗
(event: any)

Source from the content-addressed store, hash-verified

301 }
302
303 const onScroll = (event: any) => {
304 if (!state.busy) {
305 state.busy = true
306 state.current = event.target[getScrollType(horizontal)]
307 raf.onStart(() => {
308 state.layers.forEach(layer =>
309 layer.setPosition(state.space, state.current)
310 )
311 state.busy = false
312 })
313 }
314 }
315
316 useEffect(() => state.update())
317 useOnce(() => {

Callers 1

handleScrollFunction · 0.50

Calls 3

getScrollTypeFunction · 0.85
forEachMethod · 0.80
setPositionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…