Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Also fixing some broken lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmtam committed Mar 25, 2020
1 parent ce4a255 commit 488eb9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/components/control-component-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ function createControlClass(s) {
this.handleLoad();
}

UNSAFE_componentWillReceiveProps({ modelValue }) {
if (modelValue !== this.props.modelValue) {
this.setViewValue(modelValue);
}
}

shouldComponentUpdate(nextProps, nextState) {
return !shallowEqual(this.props, nextProps, {
deepKeys: ['controlProps'],
Expand Down Expand Up @@ -388,6 +382,13 @@ function createControlClass(s) {
return this.props.getValue(event, this.props);
}

/* eslint-disable camelcase */
UNSAFE_componentWillReceiveProps({ modelValue }) {
if (modelValue !== this.props.modelValue) {
this.setViewValue(modelValue);
}
}

handleIntents() {
const {
model,
Expand Down
13 changes: 7 additions & 6 deletions src/components/form-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ function createFormClass(s = defaultStrategy) {
clearGetFormCacheForModel(this.props.model);
}

UNSAFE_componentWillReceiveProps(nextProps) {
if (containsEvent(nextProps.validateOn, 'change')) {
this.validate(nextProps);
}
}

shouldComponentUpdate(nextProps, nextState) {
return deepCompareChildren(this, nextProps, nextState);
}
Expand All @@ -123,6 +117,13 @@ function createFormClass(s = defaultStrategy) {
}
}

/* eslint-disable camelcase */
UNSAFE_componentWillReceiveProps(nextProps) {
if (containsEvent(nextProps.validateOn, 'change')) {
this.validate(nextProps);
}
}

handleUpdate() {
if (this.props.onUpdate) {
this.props.onUpdate(this.props.formValue);
Expand Down

0 comments on commit 488eb9e

Please sign in to comment.