Skip to content

Commit

Permalink
Fix prop-types and createClass warning, #5678
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed May 18, 2017
1 parent 8d5ecfb commit 8703145
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions components/form/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions components/icon/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
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;
let iconNode;

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');
});
Expand Down
2 changes: 1 addition & 1 deletion components/icon/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import React from 'react';
import classNames from 'classnames';
import omit from 'omit.js';

Expand Down
3 changes: 2 additions & 1 deletion components/input/Input.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
5 changes: 3 additions & 2 deletions components/radio/radio.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -15,6 +15,7 @@ export default class Radio extends React.Component<RadioProps, any> {

static defaultProps = {
prefixCls: 'ant-radio',
type: 'radio',
};

static contextTypes = {
Expand Down Expand Up @@ -56,7 +57,7 @@ export default class Radio extends React.Component<RadioProps, any> {
onMouseEnter={props.onMouseEnter}
onMouseLeave={props.onMouseLeave}
>
<RcRadio
<RcCheckbox
{...radioProps}
prefixCls={prefixCls}
/>
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion site/theme/template/Content/Article.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 8703145

Please sign in to comment.