Skip to content

Commit 0089af0

Browse files
committed
Clear child layout hashes when children prop changes.
1 parent b57e0f5 commit 0089af0

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

dash/dash-renderer/src/reducers/reducer.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import {forEach, includes, isEmpty, keys, path, assoc, pathOr} from 'ramda';
1+
import {
2+
forEach,
3+
includes,
4+
isEmpty,
5+
keys,
6+
path,
7+
assoc,
8+
pathOr,
9+
pickBy
10+
} from 'ramda';
211
import {combineReducers} from 'redux';
312

413
import {getCallbacksByInput} from '../actions/dependencies_ts';
@@ -49,6 +58,14 @@ const layoutHashes = (state = {}, action) => {
4958
},
5059
state
5160
);
61+
62+
if ('children' in action.payload.props) {
63+
// clear all child paths hashes
64+
const childrenPath = stringifyPath(
65+
actionPath.concat(['props', 'children'])
66+
);
67+
state = pickBy((_, key) => !key.startsWith(childrenPath), state);
68+
}
5269
}
5370
return state;
5471
};

0 commit comments

Comments
 (0)