From 2aea6b31309614ca61f9e80358ca4157d17ca8cf Mon Sep 17 00:00:00 2001 From: Yash Date: Fri, 5 Apr 2024 09:20:18 +0000 Subject: [PATCH] fix type error --- apps/web/src/components/Sidebar/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/web/src/components/Sidebar/index.tsx b/apps/web/src/components/Sidebar/index.tsx index b7230291..b8c1fbb8 100644 --- a/apps/web/src/components/Sidebar/index.tsx +++ b/apps/web/src/components/Sidebar/index.tsx @@ -12,7 +12,7 @@ import { useMemory } from "@/contexts/MemoryContext"; export type MenuItem = { icon: React.ReactNode | React.ReactNode[]; label: string; - content?: React.ReactElement; + content?: React.ReactNode; }; const menuItemsBottom: Array = [ @@ -43,8 +43,9 @@ export default function Sidebar({ const menuItems = [...menuItemsTop, ...menuItemsBottom]; const [selectedItem, setSelectedItem] = useState(null); - const Subbar = - menuItems.find((i) => i.label === selectedItem)?.content ?? (() => <>); + const Subbar = menuItems.find((i) => i.label === selectedItem)?.content ?? ( + <> + ); useEffect(() => { void selectChange?.(selectedItem); @@ -85,10 +86,6 @@ export default function Sidebar({ /> - {/* @yxshv idk why this is giving typeerror - when used as it says it's not valid element type - */} - {/* @ts-ignore */} {selectedItem && {Subbar}}