I am trying to incorporate the jquery waypoints module. I am experiencing ALL of these issues in every attempt to use the module in reactjs.-- in this case I get an each of undefined - but I have tried to even use a local version of the lib and add to the top of the file
window.jQuery = window.$ = require("jquery");
http://imakewebthings.com/waypoints/guides/getting-started/
http://imakewebthings.com/waypoints/api/waypoint/
http://imakewebthings.com/waypoints/shortcuts/inview/
waypoint Uncaught TypeError: Cannot read property 'each' of undefined
Waypoint npm - Error: Can't resolve 'waypoint
in some instances - it errors -- "TypeError:`_libs_jquery_waypoints_js__WEBPACK_IMPORTED_MODULE_3___default.a is not a constructor"`
https://github.com/imakewebthings/waypoints/issues/559
importing like this
import Waypoint from './libs/jquery.waypoints.js';
code
var ele
new Waypoint({
element: ele = $('.threesixty')[0],
handler: function(direction) {
if (direction == 'down') {
$(ele).addClass('muestra')
} else {
$(ele).removeClass('muestra')
}
console.log(direction);
}
});