Skip to content

Commit

Permalink
fix(Form): endless loop while setValues
Browse files Browse the repository at this point in the history
  • Loading branch information
bindoon committed Dec 31, 2019
1 parent ccce4b3 commit 85b0471
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/form/form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ export default class Form extends React.Component {

componentWillReceiveProps(nextProps) {
if (this._formField) {
if ('value' in nextProps) {
if ('value' in nextProps && nextProps.value !== this.props.value) {
this._formField.setValues(nextProps.value);
}
if ('error' in nextProps) {
if ('error' in nextProps && nextProps.error !== this.props.error) {
this._formField.setErrors(nextProps.error);
}
}
Expand Down

0 comments on commit 85b0471

Please sign in to comment.