ant-design/components/image/index.tsx

13 lines
435 B
TypeScript
Raw Normal View History

import * as React from 'react';
import RcImage, { ImageProps } from 'rc-image';
2020-10-12 10:59:09 +08:00
import { ConfigContext } from '../config-provider';
const Image: React.FC<ImageProps> = ({ prefixCls: customizePrefixCls, ...otherProps }) => {
2020-10-12 10:59:09 +08:00
const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('image', customizePrefixCls);
return <RcImage prefixCls={prefixCls} {...otherProps} />;
};
export default Image;