Browse Source

Remove sCU from Form (#10029)

Related #9790

Form and Form.Item are not considered as pure components
pull/10138/merge
Wei Zhu 7 years ago
committed by 偏右
parent
commit
61e4f8011a
  1. 5
      components/form/Form.tsx
  2. 5
      components/form/FormItem.tsx

5
components/form/Form.tsx

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import createDOMForm from 'rc-form/lib/createDOMForm';
import createFormField from 'rc-form/lib/createFormField';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
import omit from 'omit.js';
import warning from '../_util/warning';
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.');
}
shouldComponentUpdate(...args: any[]) {
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
}
getChildContext() {
const { layout } = this.props;
return {

5
components/form/FormItem.tsx

@ -3,7 +3,6 @@ import * as ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import Animate from 'rc-animate';
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
import Row from '../grid/row';
import Col, { ColProps } from '../grid/col';
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() {
const props = this.props;
const onlyControl = this.getOnlyControl();

Loading…
Cancel
Save