@@ -55,11 +55,6 @@ type MemoizedKeysType = {
55
55
[ key : string ] : React . ReactNode | null ; // This includes React elements, strings, numbers, etc.
56
56
} ;
57
57
58
- // Define a type for the memoized props
59
- type MemoizedPropsType = {
60
- [ key : string ] : any ;
61
- } ;
62
-
63
58
function DashWrapper ( {
64
59
componentPath,
65
60
_dashprivate_error,
@@ -69,7 +64,6 @@ function DashWrapper({
69
64
} : DashWrapperProps ) {
70
65
const dispatch = useDispatch ( ) ;
71
66
const memoizedKeys : MutableRefObject < MemoizedKeysType > = useRef ( { } ) ;
72
- const memoizedProps : MutableRefObject < MemoizedPropsType > = useRef ( { } ) ;
73
67
const newRender = useRef ( false ) ;
74
68
let renderComponent : any = null ;
75
69
let renderComponentProps : any = null ;
@@ -88,21 +82,18 @@ function DashWrapper({
88
82
89
83
useMemo ( ( ) => {
90
84
if ( _newRender ) {
91
- memoizedProps . current = { } ;
92
85
newRender . current = true ;
93
86
renderH = 0 ;
94
- if ( h in memoizedKeys . current ) {
95
- delete memoizedKeys . current [ h ] ;
87
+ if ( renderH in memoizedKeys . current ) {
88
+ delete memoizedKeys . current [ renderH ] ;
96
89
}
97
90
} else {
98
91
newRender . current = false ;
99
92
}
100
93
} , [ _newRender ] ) ;
101
94
102
- memoizedProps . current = componentProps ;
103
-
104
95
const setProps = ( newProps : UpdatePropsPayload ) => {
105
- const { id} = componentProps ;
96
+ const { id} = renderComponentProps ;
106
97
const { _dash_error, ...restProps } = newProps ;
107
98
108
99
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -137,7 +128,7 @@ function DashWrapper({
137
128
batch ( ( ) => {
138
129
// setProps here is triggered by the UI - record these changes
139
130
// for persistence
140
- recordUiEdit ( component , newProps , dispatch ) ;
131
+ recordUiEdit ( renderComponent , newProps , dispatch ) ;
141
132
142
133
// Only dispatch changes to Dash if a watched prop changed
143
134
if ( watchedKeys . length ) {
0 commit comments