mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
Fix snapshot generate, close #7318
This commit is contained in:
parent
53ffc83d23
commit
d84452e8b8
@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import classNames from 'classnames';
|
||||
import Animate from 'rc-animate';
|
||||
import isCssAnimationSupported from '../_util/isCssAnimationSupported';
|
||||
@ -50,7 +49,9 @@ export default class Spin extends React.Component<SpinProps, any> {
|
||||
componentDidMount() {
|
||||
if (!isCssAnimationSupported()) {
|
||||
// Show text in IE8/9
|
||||
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`;
|
||||
this.setState({
|
||||
notCssAnimationSupported: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,13 +90,13 @@ export default class Spin extends React.Component<SpinProps, any> {
|
||||
}
|
||||
render() {
|
||||
const { className, size, prefixCls, tip, wrapperClassName, ...restProps } = this.props;
|
||||
const { spinning } = this.state;
|
||||
const { spinning, notCssAnimationSupported } = this.state;
|
||||
|
||||
const spinClassName = classNames(prefixCls, {
|
||||
[`${prefixCls}-sm`]: size === 'small',
|
||||
[`${prefixCls}-lg`]: size === 'large',
|
||||
[`${prefixCls}-spinning`]: spinning,
|
||||
[`${prefixCls}-show-text`]: !!tip,
|
||||
[`${prefixCls}-show-text`]: !!tip || notCssAnimationSupported,
|
||||
}, className);
|
||||
|
||||
// fix https://fb.me/react-unknown-prop
|
||||
|
Loading…
Reference in New Issue
Block a user