Skip to content

Commit

Permalink
fix: optimized scrolling performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann615 committed Aug 24, 2024
1 parent af82966 commit a1d9d4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function useTarget(

let ticking = false;
const debounceUpdatePos = debounce(updatePos,1000/60+0.1);
const scrollUpdatePos = !window.requestAnimationFrame ? ()=>{
const scrollUpdatePos = window.requestAnimationFrame ? ()=>{
if (!ticking) {
window.requestAnimationFrame(() => {
debounceUpdatePos();
Expand Down

0 comments on commit a1d9d4d

Please sign in to comment.