question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Waypoint doesn't fire after switching url

See original GitHub issue

I’m trying to implement infinite scroll with fetching data from server. On initial page load with fully browser reload everything works as expected, so waypoint fires every time when I scroll to page bottom. But if I go to page with infinite scroll from any another page (using react-router) then waypoint fires only once at page load, and never again when scrolling to page bottom. Could you please help me to figure out what can be the problem?

My code is:

import React from 'react'
import UserItem from './UserItem'
import Waypoint from 'react-waypoint'

export default (props) => {
  return (
    <div>
      <div className='users-search-result clearfix'>
        {props.users.map(user => <UserItem key={user.id} user={user} />)}
      </div>
      <Waypoint onEnter={props.onPageScroll}>
        <div className='loader' />
      </Waypoint>
    </div>
  )
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
trotzigcommented, Apr 5, 2017

I re-read your initial comment now. That was clear from the start, I was just a little quick to come to conclusions. Sorry!

The debug thing is still interesting though, it should give us a little more input. Try with a full page reload and with a react-router transition, then compare the different logs.

0reactions
trotzigcommented, Apr 5, 2017

Very interesting, glad you got it sorted! I wonder why the scrollable ancestor changed? This might be a bug in the waypoint code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is waypoints not working? - Stack Overflow
A simple $(document). ready(function() { alert('You have scrolled to my waypoint. '); }); works fine, which tells me jquery is loaded and ...
Read more >
[DOC BUG]: Fire tube, set waypoint - Cold Waters
I am a noob and a bit confused.. This doesn't seem to be just a manual error. The keys don't even work!! When...
Read more >
Waypoint elements firing on page load · Issue #355 - GitHub
I'm using waypoints to hide and show elements at certain scroll points, however when the page loads waypoints fires before #back_to_top is ...
Read more >
Switch to waypoint not working - Mission Editor Issues
When using the switch to waypoint function for AI unit the unit doesnt change waypoint. Might be because unit is attacking/patrolling an ...
Read more >
How to import waypoints into GOHUNT Maps
After you've imported all your waypoints, now would be a great time to start to organize that data. For a complete walkthrough on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found