Skip to content
Function

useOnScreen

Boolean that tells you whether an element is visible.

See useOnScreen with a live demo

@danixsoft/hooks


useOnScreen<T>(ref, rootMargin?): boolean

Type Parameters

T

T extends Element

Parameters

ref

RefObject<T>

rootMargin?

string = '0px'

Returns

boolean