Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update use-scroll.ts

Tim Wilson35ec0a5b060f
diff --git a/packages/ui/src/hooks/use-scroll.ts b/packages/ui/src/hooks/use-scroll.ts
index 058409582f..58377b9b03 100644
--- a/packages/ui/src/hooks/use-scroll.ts
+++ b/packages/ui/src/hooks/use-scroll.ts
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useState } from "react";
export function useScroll(threshold: number) {
- const [scrolled, setScrolled] = useState(false);
+ const [scrolled, setScrolled] = useState(window.scrollY > threshold);
const onScroll = useCallback(() => {
setScrolled(window.scrollY > threshold);