mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
fix: fix the error of missing custom icon className
This commit is contained in:
parent
2991e93b15
commit
71c79a3f75
@ -121,14 +121,23 @@ const InternalMenu = forwardRef<RcMenuRef, InternalMenuProps>((props, ref) => {
|
|||||||
const menuClassName = classNames(`${prefixCls}-${theme}`, className);
|
const menuClassName = classNames(`${prefixCls}-${theme}`, className);
|
||||||
|
|
||||||
// ====================== Expand Icon ========================
|
// ====================== Expand Icon ========================
|
||||||
let mergedExpandIcon: MenuProps[`expandIcon`];
|
const mergedExpandIcon: MenuProps[`expandIcon`] = (expandIconProps) => {
|
||||||
if (typeof expandIcon === 'function') {
|
const nonUnderwriteExpandIcon: any =
|
||||||
mergedExpandIcon = expandIcon;
|
typeof expandIcon === 'function'
|
||||||
} else {
|
? expandIcon(expandIconProps)
|
||||||
mergedExpandIcon = cloneElement(expandIcon || overrideObj.expandIcon, {
|
: expandIcon || overrideObj.expandIcon;
|
||||||
className: `${prefixCls}-submenu-expand-icon`,
|
|
||||||
});
|
if (nonUnderwriteExpandIcon || nonUnderwriteExpandIcon === 0) {
|
||||||
}
|
return cloneElement(nonUnderwriteExpandIcon, {
|
||||||
|
className: classNames(
|
||||||
|
`${prefixCls}-submenu-expand-icon`,
|
||||||
|
nonUnderwriteExpandIcon?.props?.className,
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return <i className={`${prefixCls}-submenu-arrow`} />;
|
||||||
|
};
|
||||||
|
|
||||||
// ======================== Context ==========================
|
// ======================== Context ==========================
|
||||||
const contextValue = React.useMemo<MenuContextProps>(
|
const contextValue = React.useMemo<MenuContextProps>(
|
||||||
|
Loading…
Reference in New Issue
Block a user