diff --git a/src/Dropdown/DropdownItem.tsx b/src/Dropdown/DropdownItem.tsx index 0a905657..9f06e557 100644 --- a/src/Dropdown/DropdownItem.tsx +++ b/src/Dropdown/DropdownItem.tsx @@ -1,12 +1,18 @@ import React from 'react' -export type DropdownItemProps = React.AnchorHTMLAttributes +type Anchor = React.AnchorHTMLAttributes & { + anchor?: true +} + +type NoAnchor = Pick & { anchor?: false } + +export type DropdownItemProps = Anchor | NoAnchor const DropdownItem = React.forwardRef( - ({ className, ...props }, ref) => { + ({ anchor = true, ...props }, ref) => { return ( -
  • - +
  • + {anchor ? : props.children}
  • ) }