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' ;
3
4
import { getStores } from './stores' ;
4
5
5
6
/**
@@ -16,9 +17,9 @@ function set_props(
16
17
for ( let y = 0 ; y < ds . length ; y ++ ) {
17
18
const { dispatch, getState} = ds [ y ] ;
18
19
let componentPath ;
19
- const { paths } = getState ( ) ;
20
+ const state = getState ( ) ;
20
21
if ( ! Array . isArray ( idOrPath ) ) {
21
- componentPath = getPath ( paths , idOrPath ) ;
22
+ componentPath = getPath ( state . paths , idOrPath ) ;
22
23
} else {
23
24
componentPath = idOrPath ;
24
25
}
@@ -30,6 +31,21 @@ function set_props(
30
31
} )
31
32
) ;
32
33
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
+ ) ;
33
49
}
34
50
}
35
51
You can’t perform that action at this time.
0 commit comments