Skip to content

Commit

Permalink
usescrolltrigger onProgress deps
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Dec 11, 2024
1 parent 191ae06 commit 2681cf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"css.lint.unknownAtRules": "ignore",
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
4 changes: 2 additions & 2 deletions hooks/use-scroll-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export function useScrollTrigger(

let viewportStart = isNumber(viewportStartKeyword)
? Number.parseFloat(viewportStartKeyword)
: windowHeight
: 0
if (viewportStartKeyword === 'top') viewportStart = 0
if (viewportStartKeyword === 'center') viewportStart = windowHeight * 0.5
if (viewportStartKeyword === 'bottom') viewportStart = windowHeight
Expand Down Expand Up @@ -238,7 +238,7 @@ export function useScrollTrigger(
),
})
},
[endValue, startValue, steps, onProgress]
[endValue, startValue, steps, ...deps]
)

// eslint-disable-next-line no-unused-vars
Expand Down

1 comment on commit 2681cf3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡️ Lighthouse report for the changes in this commit:

🟢 Performance: 100
🟢 Accessibility: 90
🟢 Best practices: 96
🟠 SEO: 63

Lighthouse ran on https://satus-cmo858bg8-darkroom-engineering.vercel.app/

Please sign in to comment.