From 6cd2c276ebc829ffd05a4719881308de22d0f8ee Mon Sep 17 00:00:00 2001 From: TinsFox Date: Sun, 3 Nov 2024 00:35:14 +0800 Subject: [PATCH] fix: fix duplicate dependency issues --- src/components/nav-sidebar/nav-main.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/nav-sidebar/nav-main.tsx b/src/components/nav-sidebar/nav-main.tsx index 48cea86..928cfe7 100644 --- a/src/components/nav-sidebar/nav-main.tsx +++ b/src/components/nav-sidebar/nav-main.tsx @@ -23,6 +23,8 @@ import { } from "@/components/ui/sidebar" import type { IMenu } from "@/models/menu" +import { Button } from "../ui/button" + export function NavMain({ items, }: { @@ -59,7 +61,7 @@ export function NavMain({ if (hasChanges) { setOpenItems(newOpenItems) } - }, [location.pathname, items, isPathActive, isParentActive, setOpenItems, openItems]) + }, [location.pathname, items, isPathActive, isParentActive]) const handleToggle = (title: string) => { setOpenItems((prev) => ({ @@ -83,8 +85,10 @@ export function NavMain({
Platform - +
{items.map((item) => (