Fix types and lint

This commit is contained in:
Wei Zhu 2017-10-09 21:03:00 +08:00
parent c5487ad1eb
commit a3c3ec8070
5 changed files with 6 additions and 15 deletions

View File

@ -1,4 +1,3 @@
import { render } from 'enzyme';
import demoTest from '../../../tests/shared/demoTest';
demoTest('breadcrumb', { skip: ['router.md', 'router-4.md'] });

View File

@ -95,7 +95,7 @@ export default class Button extends React.Component<ButtonProps, any> {
}
if (typeof loading !== 'boolean' && loading && loading.delay) {
this.delayTimeout = setTimeout(() => this.setState({ loading }), loading.delay);
this.delayTimeout = window.setTimeout(() => this.setState({ loading }), loading.delay);
} else {
this.setState({ loading });
}
@ -114,7 +114,7 @@ export default class Button extends React.Component<ButtonProps, any> {
// Add click effect
this.setState({ clicked: true });
clearTimeout(this.timeout);
this.timeout = setTimeout(() => this.setState({ clicked: false }), 500);
this.timeout = window.setTimeout(() => this.setState({ clicked: false }), 500);
const onClick = this.props.onClick;
if (onClick) {

View File

@ -73,7 +73,7 @@ export default class Spin extends React.Component<SpinProps, any> {
clearTimeout(this.debounceTimeout);
}
if (currentSpinning && !spinning) {
this.debounceTimeout = setTimeout(() => this.setState({ spinning }), 200);
this.debounceTimeout = window.setTimeout(() => this.setState({ spinning }), 200);
if (this.delayTimeout) {
clearTimeout(this.delayTimeout);
}
@ -82,7 +82,7 @@ export default class Spin extends React.Component<SpinProps, any> {
if (this.delayTimeout) {
clearTimeout(this.delayTimeout);
}
this.delayTimeout = setTimeout(() => this.setState({ spinning }), delay);
this.delayTimeout = window.setTimeout(() => this.setState({ spinning }), delay);
} else {
this.setState({ spinning });
}

View File

@ -61,7 +61,7 @@ export default class TransferList extends React.Component<TransferListProps, any
}
componentDidMount() {
this.timer = setTimeout(() => {
this.timer = window.setTimeout(() => {
this.setState({
mounted: true,
});
@ -100,7 +100,7 @@ export default class TransferList extends React.Component<TransferListProps, any
}
// Manually trigger scroll event for lazy search bug
// https://github.com/ant-design/ant-design/issues/5631
this.triggerScrollTimer = setTimeout(() => {
this.triggerScrollTimer = window.setTimeout(() => {
const listNode = findDOMNode(this).querySelectorAll('.ant-transfer-list-content')[0];
if (listNode) {
triggerEvent(listNode, 'scroll');

View File

@ -78,12 +78,6 @@ declare module 'rc-form*';
declare module 'react-lazy-load';
declare var process: {
env: {
NODE_ENV: string
}
};
declare module "*.json" {
const value: any;
export const version: string;
@ -91,5 +85,3 @@ declare module "*.json" {
}
declare module "prop-types"
declare function require(name: string): any;