To use IntersectionDetector, you can import the component from the @dhis2/ui library
import { IntersectionDetector } from '@dhis2/ui'| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| rootRef | { "current": "instanceOf(HTMLElement)" } |
* | React ref on other component to detect intersections with | |
| onChange | function | * | Called with signature ({ isIntersecting: bool }) |
|
| children | any | |||
| className | string | |||
| dataTest | string | 'dhis2-uicore-intersectiondetector' |
||
| threshold | number | 0 |
The threshold value: a value from 0.0 to 1.0 that controls the point at which an intersecting component is considered 'intersected' or 'visible' and the onChange callback triggers |