Files
ant-design/components/button/IconWrapper.tsx
lijianan 19137493b4 perf: uninstall classnames, install clsx (#55164)
* refactor: uninstall classnames & install clsx

* refactor: uninstall classnames & install clsx

* test: rename test fn

* test: update snap

* update

* update

* update

* update

* update snap

* update

* update

---------

Signed-off-by: lijianan <574980606@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
2025-10-01 00:45:54 +08:00

24 lines
562 B
TypeScript

import React, { forwardRef } from 'react';
import { clsx } from 'clsx';
export type IconWrapperProps = {
prefixCls: string;
className?: string;
style?: React.CSSProperties;
children?: React.ReactNode;
};
const IconWrapper = forwardRef<HTMLSpanElement, IconWrapperProps>((props, ref) => {
const { className, style, children, prefixCls } = props;
const iconWrapperCls = clsx(`${prefixCls}-icon`, className);
return (
<span ref={ref} className={iconWrapperCls} style={style}>
{children}
</span>
);
});
export default IconWrapper;