Bolt: Optimize Navbar scroll handler #38

Merged
ragusa-it merged 1 commits from bolt-navbar-scroll-optimization-12203924683712473060 into main 2026-01-30 04:53:13 +00:00

1 Commits

Author SHA1 Message Date
google-labs-jules[bot]
51547318e1 perf(navbar): optimize scroll handler to reduce state updates
- Introduces a local tracking variable in `Navbar` scroll effect to prevent redundant `setState` calls during scroll.
- Ensures the state is correctly initialized on mount if the page is already scrolled.
- Uses `requestAnimationFrame` for efficient scroll handling.

This reduces the number of React reconciliation cycles during scrolling, improving main thread performance.

Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
2026-01-30 01:44:56 +00:00