diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index a19c661711..04b291cd00 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -4,13 +4,13 @@ import AnchorHelper, { scrollTo } from './anchorHelper'; export interface AnchorLinkProps { href: string; - onClick: (href: string, component: Element) => void; + onClick?: (href: string, component: Element) => void; active?: boolean; prefixCls?: string; children?: any; - title?: React.ReactNode; - offsetTop: number; - bounds: number; + title: React.ReactNode; + offsetTop?: number; + bounds?: number; target?: () => HTMLElement | Window; affix?: boolean; } diff --git a/components/anchor/index.tsx b/components/anchor/index.tsx index 135b9fa2f6..f34d6d6a2f 100644 --- a/components/anchor/index.tsx +++ b/components/anchor/index.tsx @@ -6,8 +6,8 @@ import Affix from '../affix'; import AnchorHelper, { getDefaultTarget } from './anchorHelper'; export interface AnchorProps { - target: () => HTMLElement | Window; - children: React.ReactNode; + target?: () => HTMLElement | Window; + children?: React.ReactNode; prefixCls?: string; offsetTop?: number; bounds?: number;