diff --git a/components/core/dock.tsx b/components/core/dock.tsx index 36164d84..dc8571db 100644 --- a/components/core/dock.tsx +++ b/components/core/dock.tsx @@ -18,6 +18,7 @@ import { useMemo, useRef, useState, + React } from 'react'; import { cn } from '@/lib/utils'; @@ -160,7 +161,12 @@ function DockItem({ children, className }: DockItemProps) { aria-haspopup='true' > {Children.map(children, (child) => - cloneElement(child as React.ReactElement, { width, isHovered }) + React.isValidElement(child) + ? cloneElement(child as React.ReactElement<{ width: MotionValue; isHovered: MotionValue }>, { + width, + isHovered, + }) + : child )} );