Skip to content

Releases: civiccc/react-waypoint

3.1.3

28 Sep 09:32
Compare
Choose a tag to compare

Changes:

  • Avoid warnings from React about calling PropTypes directly (#119).

3.1.2

15 Sep 10:34
Compare
Choose a tag to compare

This version contains a fix for errors of the following kind:

Unable to get property 'getBoundingClientRect' of undefined or null reference

3.1.1

03 Aug 21:46
Compare
Choose a tag to compare

Changes:

  • Fix passing props to super class, to make react-waypoint compatible with preact (thanks @kamotos!)

v3.1.0

13 Jul 15:09
Compare
Choose a tag to compare

New properties have been added to the onEnter/onLeave/onPositionChange callbacks:

  • waypointTop - the waypoint's distance to the top of the viewport.
  • viewportTop - the distance from the scrollable ancestor to the viewport top.
  • viewportBottom - the distance from the bottom of the scrollable ancestor to the viewport top.

v3.0.0

27 Jun 18:43
Compare
Choose a tag to compare

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 and topOffset. This means that you can trigger callbacks differently on the top and bottom edges (previous prop threshold 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%' />

v2.0.2

02 May 08:16
Compare
Choose a tag to compare

Changes:

  • Improved calculation to determine waypoint position

v2.0.1

09 Apr 20:11
Compare
Choose a tag to compare

We're now on React ^15.0.0. There were no changes needed to be made in order to support this version of React. We still allow peer dependencies on ^0.14.0 (which was the version before 15).

Thanks to @axelg12 for reporting this and @kamui for taking the time to fix it!

v2.0.0

08 Apr 07:13
Compare
Choose a tag to compare

In this release, the arguments passed to onEnter, onLeave and onPositionChange has changed. Before, arguments would be listed as a flat arguments list starting with event. Now everything is combined into a single object, passed down as a single argument. To upgrade, change event handlers from this

<Waypoint onEnter={(event, from) => {
    // do something useful
  }}
/>

to this

<Waypoint onEnter={({ previousPosition, currentPosition, event }) => {
    // do something useful
  }}
/>

Or, if you are more familiar with plain old js functions (i.e. no arrow functions or object destructuring), you'll do something like this:

<Waypoint onEnter={function(props) {
    // here you can use `props.currentPosition`, `props.previousPosition`, and
    // `props.event`
  }}
/>

See the section on Prop types in the README for more information.

v1.3.1

31 Mar 11:39
Compare
Choose a tag to compare

Changes:

  • Improved handling of waypoint being rendered in invisible container (a6dc4d9, thanks @tomdcc!)

v1.3.0

16 Feb 11:27
Compare
Choose a tag to compare

Changes:

  • The scrollableParent prop has been renamed to scrollableAncestor. If you try to use the old name, an error is thrown informing you about it.