Skip to content

Commit 7086b38

Browse files
committed
fix(deploy): fix deploy Vercel
1 parent a266b32 commit 7086b38

File tree

1 file changed

+7
-2
lines changed
  • github-automated-repos-page/new/src/app/components/Sidebar

1 file changed

+7
-2
lines changed

github-automated-repos-page/new/src/app/components/Sidebar/Sidebar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22
import Image from "next/image";
33
import logoLib from "../../../../public/logoLib.svg";
4-
import { useState } from "react";
4+
import { useEffect, useState } from "react";
55
import Link from "next/link";
66
import useCollapse from 'react-collapsed';
77
import { MdOutlineNavigateNext} from 'react-icons/md';
@@ -22,7 +22,12 @@ export default function Sidebar() {
2222
setScroll(ScrollPercent)
2323
console.log(ScrollPercent)
2424
};
25-
window.addEventListener("scroll", onScroll);
25+
26+
useEffect(() => {
27+
window.addEventListener("scroll", onScroll)
28+
}, []);
29+
30+
2631
return (
2732
<aside className=" fixed min-w-[340px] h-full max-lg:hidden w-0">
2833

0 commit comments

Comments
 (0)