File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed
dash/dash-renderer/src/utils Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 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' ;
34import { 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
You can’t perform that action at this time.
0 commit comments