diff --git a/.vscode/settings.json b/.vscode/settings.json index cde0409..51890e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,8 @@ "css.lint.unknownAtRules": "ignore", "[javascript]": { "editor.defaultFormatter": "biomejs.biome" + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" } } diff --git a/hooks/use-scroll-trigger.ts b/hooks/use-scroll-trigger.ts index c82a38d..06cdd42 100644 --- a/hooks/use-scroll-trigger.ts +++ b/hooks/use-scroll-trigger.ts @@ -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 @@ -238,7 +238,7 @@ export function useScrollTrigger( ), }) }, - [endValue, startValue, steps, onProgress] + [endValue, startValue, steps, ...deps] ) // eslint-disable-next-line no-unused-vars