React useIntersect Hooks
Install
npm install --save use-intersect
Usage
API
useIntersect
Prop | Type | Required | Description |
---|---|---|---|
onIntersect |
Function | ✓ | Execute onItersect Function |
IntersectOptions |
IntersectOptions | Intersect option |
IntersectOptions
type
name | Type | Required | Description |
---|---|---|---|
rootOptions |
ObserverOptions |
ObserverOptions | |
once |
boolean | [default:true] Trigger onItersect once |
ObserverOptions
type
name | Type | Required | Description |
---|---|---|---|
root |
Element | null | root Element | |
rootMargin |
string | Observer rootMargin | |
threshold |
number | Observer threshold |
License
MIT © 🐭snyung