Fix prop-types and createClass warning, #5678

This commit is contained in:
afc163 2017-05-18 14:22:47 +08:00
parent 8d5ecfbd12
commit 8703145d70
7 changed files with 19 additions and 13 deletions

View File

@ -1042,6 +1042,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
<input
checked=""
class="ant-checkbox-input"
data-__meta="[object Object]"
type="checkbox"
/>
<span
@ -1475,6 +1476,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = `
>
<input
class="ant-checkbox-input"
data-__meta="[object Object]"
type="checkbox"
/>
<span

View File

@ -1,9 +1,12 @@
import React from 'react';
import TestUtils from 'react-dom/test-utils';
import { wrap } from 'react-stateless-wrapper';
import AntIcon from '..';
import Icon from '..';
const Icon = wrap(AntIcon);
class Wrapper extends React.Component {
render() {
return this.props.children;
}
}
describe('Icon', () => {
let icon;
@ -11,7 +14,7 @@ describe('Icon', () => {
beforeEach(() => {
icon = TestUtils.renderIntoDocument(
<Icon type="appstore" className="my-icon-classname" />
<Wrapper><Icon type="appstore" className="my-icon-classname" /></Wrapper>
);
iconNode = TestUtils.findRenderedDOMComponentWithTag(icon, 'I');
});

View File

@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import classNames from 'classnames';
import omit from 'omit.js';

View File

@ -1,5 +1,6 @@
import React from 'react';
import { Component, PropTypes, cloneElement } from 'react';
import { Component, cloneElement } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import calculateNodeHeight from './calculateNodeHeight';
import assign from 'object-assign';

View File

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import RcRadio from 'rc-radio';
import RcCheckbox from 'rc-checkbox';
import classNames from 'classnames';
import shallowEqual from 'shallowequal';
import { AbstractCheckboxProps } from '../checkbox/Checkbox';
@ -15,6 +15,7 @@ export default class Radio extends React.Component<RadioProps, any> {
static defaultProps = {
prefixCls: 'ant-radio',
type: 'radio',
};
static contextTypes = {
@ -56,7 +57,7 @@ export default class Radio extends React.Component<RadioProps, any> {
onMouseEnter={props.onMouseEnter}
onMouseLeave={props.onMouseLeave}
>
<RcRadio
<RcCheckbox
{...radioProps}
prefixCls={prefixCls}
/>

View File

@ -47,7 +47,7 @@
"rc-animate": "~2.3.0",
"rc-calendar": "~8.1.0",
"rc-cascader": "~0.11.0",
"rc-checkbox": "~1.5.0",
"rc-checkbox": "~2.0.0",
"rc-collapse": "~1.7.0",
"rc-dialog": "~6.5.0",
"rc-dropdown": "~1.4.8",
@ -58,13 +58,12 @@
"rc-notification": "~1.4.0",
"rc-pagination": "~1.8.7",
"rc-progress": "~2.1.0",
"rc-radio": "~2.0.0",
"rc-rate": "~2.1.0",
"rc-select": "~6.8.0",
"rc-slider": "~7.0.0",
"rc-steps": "~2.5.0",
"rc-switch": "~1.4.2",
"rc-table": "~5.2.13",
"rc-table": "~5.3.3",
"rc-tabs": "~7.5.0",
"rc-time-picker": "~2.4.0",
"rc-tooltip": "~3.4.2",
@ -133,7 +132,6 @@
"react-dom": "^15.0.0",
"react-github-button": "^0.1.1",
"react-intl": "^2.0.1",
"react-stateless-wrapper": "^1.0.2",
"react-sublime-video": "^0.2.0",
"react-test-renderer": "^15.5.4",
"reqwest": "^2.0.5",

View File

@ -1,4 +1,5 @@
import React, { PropTypes, Children, cloneElement } from 'react';
import React, { Children, cloneElement } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import DocumentTitle from 'react-document-title';
import { getChildren } from 'jsonml.js/lib/utils';