npm react-waypoint 2.0.0
v2.0.0

latest releases: 10.3.0, 10.1.0, 10.0.0...
8 years ago

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.

Don't miss a new react-waypoint release

NewReleases is sending notifications on new releases.