File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
app/components/StateRoute/ComponentMap Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -520,12 +520,12 @@ export default function ComponentMap({
520
520
}
521
521
/>
522
522
{ /* Add this new container for reducer state */ }
523
- { tooltipData . componentData . reducerState && (
523
+ { /* { tooltipData.componentData.reducerState && (
524
524
<ToolTipDataDisplay
525
525
containerName='Reducer State'
526
526
dataObj={tooltipData.componentData.reducerState}
527
527
/>
528
- ) }
528
+ )} */ }
529
529
</ div >
530
530
</ div >
531
531
</ TooltipInPortal >
Original file line number Diff line number Diff line change @@ -222,14 +222,14 @@ export default function createTree(currentFiberNode: Fiber): Tree {
222
222
if ( isReducer ) {
223
223
// If it's a reducer, store its state
224
224
componentData . reducerState = state ;
225
- } else {
226
- // Otherwise treat as useState
227
- componentData . hooksState [ hooksNames [ i ] ?. varName || `state${ i } ` ] = state ;
228
225
}
226
+ // Otherwise treat as useState
227
+ componentData . hooksState [ hooksNames [ i ] ?. varName || `Reducer: ${ i } ` ] = state ;
229
228
} ) ;
230
229
231
230
// Pass to front end
232
- newState = componentData . reducerState || componentData . hooksState ;
231
+ newState = componentData . hooksState ;
232
+ console . log ( 'new state' , newState ) ;
233
233
} catch ( err ) {
234
234
console . log ( 'Error extracting functional component state:' , {
235
235
componentName,
Original file line number Diff line number Diff line change @@ -80,9 +80,7 @@ export function getHooksStateAndUpdateMethod(
80
80
state : memoizedState . memoizedState ,
81
81
isReducer : true ,
82
82
} ) ;
83
- }
84
- // Existing useState check
85
- if ( memoizedState . queue ) {
83
+ } else if ( memoizedState . queue ) {
86
84
hooksStates . push ( {
87
85
component : memoizedState . queue ,
88
86
state : memoizedState . memoizedState ,
You can’t perform that action at this time.
0 commit comments