@@ -65,6 +65,7 @@ function DashWrapper({
65
65
const dispatch = useDispatch ( ) ;
66
66
const memoizedKeys : MutableRefObject < MemoizedKeysType > = useRef ( { } ) ;
67
67
const newRender = useRef ( false ) ;
68
+ const renderedPath : any = useRef ( null ) ;
68
69
let renderComponent : any = null ;
69
70
let renderComponentProps : any = null ;
70
71
let renderH : any = null ;
@@ -90,9 +91,10 @@ function DashWrapper({
90
91
} else {
91
92
newRender . current = false ;
92
93
}
94
+ renderedPath . current = componentPath
93
95
} , [ _newRender ] ) ;
94
96
95
- const setProps = ( newProps : UpdatePropsPayload ) => {
97
+ const setProps = useCallback ( ( newProps : UpdatePropsPayload ) => {
96
98
const { id} = renderComponentProps ;
97
99
const { _dash_error, ...restProps } = newProps ;
98
100
@@ -101,7 +103,7 @@ function DashWrapper({
101
103
dispatch ( ( dispatch , getState ) => {
102
104
const currentState = getState ( ) ;
103
105
const { graphs} = currentState ;
104
- const oldLayout = getComponentLayout ( componentPath , currentState ) ;
106
+ const oldLayout = getComponentLayout ( renderedPath . current , currentState ) ;
105
107
if ( ! oldLayout ) return ;
106
108
const { props : oldProps } = oldLayout ;
107
109
if ( ! oldProps ) return ;
@@ -144,13 +146,13 @@ function DashWrapper({
144
146
dispatch (
145
147
updateProps ( {
146
148
props : changedProps ,
147
- itempath : componentPath ,
149
+ itempath : renderedPath . current ,
148
150
renderType : 'internal'
149
151
} )
150
152
) ;
151
153
} ) ;
152
154
} ) ;
153
- } ;
155
+ } , [ componentPath ] ) ;
154
156
155
157
const createContainer = useCallback (
156
158
( container , containerPath , _childNewRender , key = undefined ) => {
0 commit comments