Closed pantpad closed 2 months ago
A new render is performed every time the page is "scrolled", this is how the component works.
At each renderer the references of where you have arrived are updated and the navigation menu is updated.
A new render is performed every time the page is "scrolled", this is how the component works.
At each renderer the references of where you have arrived are updated and the navigation menu is updated.
The problem is that even if I don't scroll or interact with the page in any way, re-renderings keep happening. In a couple of seconds I get almost 1000 re-renders.
Is this supposed to happen as well?
I was able to reproduce and hopefully fix the issue that @pantpad reported: please take a look at #1061.
@Nick87 thank you so much! @pantpad a new version (5.0.4) is now available on NPM with #1061 included! let us know if everything runs fine now!
Describe the bug Using the useNavScroll hook and its register function triggers an infinite re-rendering of the component.
To Reproduce Steps to reproduce the behavior:
Expected behavior The useNavScroll seems to work as intended, it simply creates an infinite re-render of the page.
Screenshots![Screenshot 2023-06-12 165102](https://github.com/italia/design-react-kit/assets/138708449/c0ad76ff-c6f7-4401-ae7c-7251c334849c)