diff --git a/src/components/Toc/Toc.tsx b/src/components/Toc/Toc.tsx index a29575dbe1..b96ab6ec1b 100644 --- a/src/components/Toc/Toc.tsx +++ b/src/components/Toc/Toc.tsx @@ -14,7 +14,7 @@ export interface TocProps extends QAProps { className?: string; items: TocItemType[]; value?: string; - onUpdate?: (value: string) => void; + onUpdate?: (value: string, event?: React.MouseEvent) => void; } export const Toc = React.forwardRef(function Toc(props, ref) { @@ -32,7 +32,7 @@ export const Toc = React.forwardRef(function Toc(props, r active={activeValue === value} onClick={onUpdate} /> - {childrenItems?.length && ( + {childrenItems && childrenItems.length > 0 && (