Function yew_hooks::use_scrolling
source · [−]Expand description
A sensor hook that tracks whether HTML element is scrolling.
Example
use yew_hooks::use_scrolling;
#[function_component(UseScrolling)]
fn scrolling() -> Html {
let node = use_node_ref();
let state = use_scrolling(node.clone());
html! {
<div ref={node}>
<b>{ " Scrolling: " }</b>
{ state }
</div>
}
}