mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
fix: import multiple times
This commit is contained in:
parent
882f343e10
commit
3e1560d753
@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import { createElement, Component } from 'react';
|
||||
import omit from 'omit.js';
|
||||
import classNames from 'classnames';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
@ -48,7 +47,7 @@ export interface ScrollNumberState {
|
||||
count?: string | number | null;
|
||||
}
|
||||
|
||||
class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
|
||||
class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState> {
|
||||
static defaultProps = {
|
||||
count: null,
|
||||
onAnimated() {},
|
||||
@ -127,7 +126,7 @@ class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
|
||||
const position = this.getPositionByNum(num, i);
|
||||
const removeTransition =
|
||||
this.state.animateStarted || getNumberArray(this.lastCount)[i] === undefined;
|
||||
return createElement(
|
||||
return React.createElement(
|
||||
'span',
|
||||
{
|
||||
className: `${prefixCls}-only`,
|
||||
@ -201,7 +200,7 @@ class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
|
||||
),
|
||||
});
|
||||
}
|
||||
return createElement(component as any, newProps, this.renderNumberElement(prefixCls));
|
||||
return React.createElement(component as any, newProps, this.renderNumberElement(prefixCls));
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import { cloneElement } from 'react';
|
||||
import * as PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import BreadcrumbItem from './BreadcrumbItem';
|
||||
@ -152,7 +151,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
"Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children",
|
||||
);
|
||||
|
||||
return cloneElement(element, {
|
||||
return React.cloneElement(element, {
|
||||
separator,
|
||||
key: index,
|
||||
});
|
||||
|
@ -1,5 +1,4 @@
|
||||
import * as React from 'react';
|
||||
import { cloneElement } from 'react';
|
||||
import { polyfill } from 'react-lifecycles-compat';
|
||||
import RcTooltip from 'rc-tooltip';
|
||||
import classNames from 'classnames';
|
||||
@ -116,7 +115,7 @@ function getDisabledCompatibleChildren(element: React.ReactElement<any>) {
|
||||
...omitted,
|
||||
pointerEvents: 'none',
|
||||
};
|
||||
const child = cloneElement(element, {
|
||||
const child = React.cloneElement(element, {
|
||||
style: buttonStyle,
|
||||
className: null,
|
||||
});
|
||||
@ -264,7 +263,7 @@ class Tooltip extends React.Component<TooltipProps, any> {
|
||||
onVisibleChange={this.onVisibleChange}
|
||||
onPopupAlign={this.onPopupAlign}
|
||||
>
|
||||
{visible ? cloneElement(child, { className: childCls }) : child}
|
||||
{visible ? React.cloneElement(child, { className: childCls }) : child}
|
||||
</RcTooltip>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user