Replies: 2 comments
-
The It might make sense to use the Ensuring the page is restored when navigating back is a different issue. I'd solve it by replacing the history state with the current |
Beta Was this translation helpful? Give feedback.
-
You should have a Consider setting a new |
Beta Was this translation helpful? Give feedback.
-
Hi!
I have an issue with implementing infinite scroll using react-intersection-observer and Redux. So I pass an list of objects and a callback to update the Redux state to my component in which I want to observe. The problem is, that after calling the Redux callback, the parent component re-renders and
inView
remains true so the callback is called again. As a consequence, state gets updated twice instead of once.As a workaround, I memorize the
entry
causing the update and skip subsequent updates if it has not changed (see below).Now, scrolling the list works and causes a single update. But this workaround causes issues when scrolling to the end of the list and reloading the page. You will not be brought back to the end of the list because it only loads one more page as the
entry
does not change. That is better than a broken mouse scroll but still somehow broken.Maybe someone has a suggestion to fix this issue? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions