Rehooks
Hooks

useScroll

A hook that returns a boolean value indicating whether the user has scrolled horizontally beyond a specified threshold.

useScroll

A hook that returns a boolean value indicating whether the user has scrolled horizontally beyond a specified threshold.

Usage

import { useScroll } from "rehooks-ts";
 
const scrolled = useScroll(100);

Parameters

NameTypeDescription
thresholdnumberThe amount of pixels to scroll before the hook returns true.

Returns

nametypedescription
scrolledbooleanA boolean value indicating whether the user scrolled.

On this page