The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update use-scroll.ts
Tim Wilson7c0f0187bc45
diff --git a/packages/ui/src/hooks/use-scroll.ts b/packages/ui/src/hooks/use-scroll.tsindex ffab03eed2..058409582f 100644--- a/packages/ui/src/hooks/use-scroll.ts+++ b/packages/ui/src/hooks/use-scroll.ts@@ -1,9 +1,7 @@import { useCallback, useEffect, useState } from "react";export function useScroll(threshold: number) {- const [scrolled, setScrolled] = useState(- typeof window !== "undefined" ? window.scrollY > threshold : false,- );+ const [scrolled, setScrolled] = useState(false);const onScroll = useCallback(() => {setScrolled(window.scrollY > threshold);