Use InView
A React hook for detecting when elements enter the viewport
Installation
Usage
The hook provides viewport intersection detection with react observer.
Example
Scroll to see me
Scroll to see me
Scroll to see me
Reference
Options
| Prop | Type | Default |
|---|---|---|
triggerOnce | boolean | true |
threshold | number | 0.1 |
Return Values
| Prop | Type | Default |
|---|---|---|
ref | (node: Element | null) => void | - |
isInView | boolean | - |
Edit on GitHub
Last updated on