Skip to content

Commit 6a51034

Browse files
committed
Fix not existing props does not update props in state
1 parent b695023 commit 6a51034

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/createConnect.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ export default function createConnect(React) {
131131
recomputeState(props = this.props) {
132132
const nextState = this.computeNextState(props);
133133
if (!shallowEqual(nextState, this.state)) {
134-
this.setState(nextState);
134+
this.setState({
135+
...Object.keys(this.state)
136+
.reduce((r, k) => ({
137+
[k]: undefined
138+
}), {}),
139+
...nextState,
140+
});
135141
}
136142
}
137143

0 commit comments

Comments
 (0)