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

Commit 350d0d5

Browse files
authored
Merge pull request #758 from dreid/pass-nextState-to-deepCompareWithChildren
Pass nextState to deepCompareChildren
2 parents 7ce0c1a + 80b8c4a commit 350d0d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/field-component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ function createFieldClass(customControlPropsMap = {}, s = defaultStrategy) {
148148
};
149149

150150
class Field extends Component {
151-
shouldComponentUpdate(nextProps) {
151+
shouldComponentUpdate(nextProps, nextState) {
152152
const { dynamic } = this.props;
153153

154154
if (dynamic) {
155-
return deepCompareChildren(this, nextProps);
155+
return deepCompareChildren(this, nextProps, nextState);
156156
}
157157

158158
return shallowCompareWithoutChildren(this, nextProps);

src/components/form-component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ function createFormClass(s = defaultStrategy) {
103103
}
104104
}
105105

106-
shouldComponentUpdate(nextProps) {
107-
return deepCompareChildren(this, nextProps);
106+
shouldComponentUpdate(nextProps, nextState) {
107+
return deepCompareChildren(this, nextProps, nextState);
108108
}
109109

110110
componentDidUpdate(prevProps) {

0 commit comments

Comments
 (0)