Changes:
- Scroll events can now be throttled to improve performance. See the README on Throttling for more information.
threshold
has been split into two new props:bottomOffset
andtopOffset
. This means that you can trigger callbacks differently on the top and bottom edges (previous propthreshold
was used for both). The new props allow pixel values (e.g.'20px'
,20
), and percentages (e.g.'5%'
).
To migrate old waypoints using threshold
, you should translate the value into a percentage, and use bottomOffset
and topOffset
.
// Old code using `threshold`
<Waypoint threshold={0.1} />
// New code using `bottomOffset` and `topOffset`
<Waypoint bottomOffset='-10%' topOffset='-10%' />
// Alternatively, you can leave out one of the two offsets
<Waypoint topOffset='-10%' />