ant-design/components/button/IconWrapper.tsx
黑雨 41ed9bd430
feat: Button semantic dom ()
* feat: add semantic doc

* 🔀 feat: rebase feature

* feat: update for code reviewer

* feat: update snap

* feat: update snap

* 🐛 bug: update for cov

* Message

* bug: update snap

* 💄 style: update style

* 💄 style: update style

* 💄 style: update style

* 💄 style: update style

* 💄 style: update style

* 💄 style: update style

* ♻️ feat: ref code

* 🩺 feat: update for review

* 💄 style: update style

* 📝 doc: update doc

* 💄  style: update style

* 💄  style: update style

* 💄 style: update style

* 💄  style: update style

* 💄  style: update style

* 💄  style: update style

* 💄  style: update style

* 📸 feat:update snap

* 🚧 feat: clean up

* 🚧 feat: clean up

* feat: icon wrapper

* test: update snapshot

* chore: code clean

* fix: icon only font size

* chore: rollback unexpected commit

---------

Co-authored-by: MadCcc <1075746765@qq.com>
2023-04-11 11:37:31 +08:00

24 lines
576 B
TypeScript

import React, { forwardRef } from 'react';
import classNames from 'classnames';
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 = classNames(`${prefixCls}-icon`, className);
return (
<span ref={ref} className={iconWrapperCls} style={style}>
{children}
</span>
);
});
export default IconWrapper;