Closed Nick87 closed 2 months ago
Fixes #1057
main
This PR resolves an infinite render loop when using useNavScroll.
useNavScroll
I propose to change the current refresh callback declaration which causes an infinite render loop. Changes have been successfully tested by copying the first example in https://italia.github.io/design-react-kit/?path=/docs/documentazione-menu-di-navigazione-navscroll--documentazione in the design-react-kit-playground project: navigation items are correctly updated and no infinite render loop occurs.
refresh
design-react-kit-playground
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Fixes #1057
PR Checklist
main
branch.Short description of what this resolves:
This PR resolves an infinite render loop when using
useNavScroll
.Changes proposed in this Pull Request:
I propose to change the current
refresh
callback declaration which causes an infinite render loop. Changes have been successfully tested by copying the first example in https://italia.github.io/design-react-kit/?path=/docs/documentazione-menu-di-navigazione-navscroll--documentazione in thedesign-react-kit-playground
project: navigation items are correctly updated and no infinite render loop occurs.