Skip to content

Commit 80c93ad

Browse files
committed
fix clientside set_props add paths
1 parent 504c824 commit 80c93ad

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

dash/dash-renderer/src/utils/clientsideFunctions.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {updateProps, notifyObservers} from '../actions/index';
2-
import {getPath} from '../actions/paths';
1+
import {updateProps, notifyObservers, setPaths} from '../actions/index';
2+
import {computePaths, getPath} from '../actions/paths';
3+
import {getComponentLayout} from '../wrapper/wrapping';
34
import {getStores} from './stores';
45

56
/**
@@ -16,9 +17,9 @@ function set_props(
1617
for (let y = 0; y < ds.length; y++) {
1718
const {dispatch, getState} = ds[y];
1819
let componentPath;
19-
const {paths} = getState();
20+
const state = getState();
2021
if (!Array.isArray(idOrPath)) {
21-
componentPath = getPath(paths, idOrPath);
22+
componentPath = getPath(state.paths, idOrPath);
2223
} else {
2324
componentPath = idOrPath;
2425
}
@@ -30,6 +31,21 @@ function set_props(
3031
})
3132
);
3233
dispatch(notifyObservers({id: idOrPath, props}));
34+
const oldComponent = getComponentLayout(componentPath, state);
35+
36+
dispatch(
37+
setPaths(
38+
computePaths(
39+
{
40+
...oldComponent,
41+
props: {...oldComponent.props, ...props}
42+
},
43+
[...componentPath],
44+
state.paths,
45+
state.paths.events
46+
)
47+
)
48+
);
3349
}
3450
}
3551

0 commit comments

Comments
 (0)