Remove sCU from Form (#10029)

Related #9790

Form and Form.Item are not considered as pure components
This commit is contained in:
Wei Zhu 2018-04-19 11:49:50 +08:00 committed by 偏右
parent d7f9270a6f
commit 61e4f8011a
2 changed files with 0 additions and 10 deletions

View File

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import createDOMForm from 'rc-form/lib/createDOMForm'; import createDOMForm from 'rc-form/lib/createDOMForm';
import createFormField from 'rc-form/lib/createFormField'; import createFormField from 'rc-form/lib/createFormField';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
import omit from 'omit.js'; import omit from 'omit.js';
import warning from '../_util/warning'; import warning from '../_util/warning';
import FormItem from './FormItem'; import FormItem from './FormItem';
@ -163,10 +162,6 @@ export default class Form extends React.Component<FormProps, any> {
warning(!props.form, 'It is unnecessary to pass `form` to `Form` after antd@1.7.0.'); warning(!props.form, 'It is unnecessary to pass `form` to `Form` after antd@1.7.0.');
} }
shouldComponentUpdate(...args: any[]) {
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
}
getChildContext() { getChildContext() {
const { layout } = this.props; const { layout } = this.props;
return { return {

View File

@ -3,7 +3,6 @@ import * as ReactDOM from 'react-dom';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames'; import classNames from 'classnames';
import Animate from 'rc-animate'; import Animate from 'rc-animate';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
import Row from '../grid/row'; import Row from '../grid/row';
import Col, { ColProps } from '../grid/col'; import Col, { ColProps } from '../grid/col';
import warning from '../_util/warning'; import warning from '../_util/warning';
@ -66,10 +65,6 @@ export default class FormItem extends React.Component<FormItemProps, any> {
); );
} }
shouldComponentUpdate(...args: any[]) {
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
}
getHelpMsg() { getHelpMsg() {
const props = this.props; const props = this.props;
const onlyControl = this.getOnlyControl(); const onlyControl = this.getOnlyControl();