Skip to main content

use_scroll

Function use_scroll 

Source
pub fn use_scroll() -> UseScroll
Expand description

Obtains the UseScroll registered against the current hook context slot.

Behaves like HookContext::use_hook - the same handle is returned on every render at the same hook index, so the window listener is attached once and the offsets survive re-renders.

ยงReturns

  • UseScroll - The handle, with get_x() and get_y() returning the reactive scroll offset signals.