Skip to content

Commit

Permalink
fix: use prefixCls in Icon.tsx (ant-design#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredleechn committed Aug 27, 2021
1 parent 2daf959 commit ec885a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/icons-react/src/components/Icon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import Context from './Context';

import { svgBaseProps, warning, useInsertStyles } from '../utils';

Expand Down Expand Up @@ -48,13 +49,15 @@ const Icon = React.forwardRef<HTMLSpanElement, IconComponentProps>((props, ref)

useInsertStyles();

const { prefixCls = 'anticon' } = React.useContext(Context);

const classString = classNames(
'anticon',
prefixCls,
className,
);

const svgClassString = classNames({
'anticon-spin': !!spin,
[`${prefixCls}-spin`]: !!spin,
});

const svgStyle = rotate
Expand Down

0 comments on commit ec885a4

Please sign in to comment.