Fixed useScroll hook warning.

This commit is contained in:
Andrés Mora 2025-12-19 06:49:05 -05:00
parent 9712e2065f
commit 2b96a395ba
2 changed files with 7 additions and 8 deletions

View File

@ -45,8 +45,8 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en" className="scroll-smooth">
<body className={`${inter.variable} ${outfit.variable} antialiased`}>
<html lang="en" className="scroll-smooth relative">
<body className={`${inter.variable} ${outfit.variable} antialiased relative`}>
{children}
</body>
</html>

View File

@ -92,7 +92,7 @@ const territories = [
];
export default function Home() {
const heroRef = useRef(null);
const heroRef = useRef<HTMLDivElement>(null);
const { scrollYProgress } = useScroll({
target: heroRef,
offset: ["start start", "end start"],
@ -106,10 +106,8 @@ export default function Home() {
<Navigation />
{/* Hero Section */}
<section
ref={heroRef}
className="relative min-h-screen flex items-center justify-center overflow-hidden bg-gradient-to-b from-neutral-50 to-white dark:from-neutral-950 dark:to-neutral-900"
>
<div ref={heroRef} className="relative">
<section className="relative min-h-screen flex items-center justify-center overflow-hidden bg-gradient-to-b from-neutral-50 to-white dark:from-neutral-950 dark:to-neutral-900">
{/* Animated background elements */}
<div className="absolute inset-0 overflow-hidden">
<motion.div
@ -260,6 +258,7 @@ export default function Home() {
</motion.div>
</motion.div>
</section>
</div>
{/* Stats Section */}
<section className="relative py-20 bg-neutral-900 dark:bg-neutral-950 overflow-hidden">