File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,14 @@ async function updateReactFiberTree(
70
70
if ( index !== null ) {
71
71
// Obtain the BOUND update method at the given index
72
72
const classComponent = componentActionsRecord . getComponentByIndex ( index ) ;
73
- // Update component state
74
- await classComponent . setState (
75
- // prevState contains the states of the snapshots we are jumping FROM, not jumping TO
76
- ( prevState ) => state ,
77
- ) ;
73
+ // This conditional avoids the error that occurs when classComponent is undefined
74
+ if ( classComponent !== undefined ) {
75
+ // Update component state
76
+ await classComponent . setState (
77
+ // prevState contains the states of the snapshots we are jumping FROM, not jumping TO
78
+ ( prevState ) => state ,
79
+ ) ;
80
+ }
78
81
// Iterate through new children after state has been set
79
82
targetSnapshot . children . forEach ( ( child ) => updateReactFiberTree ( child , circularComponentTable ) ) ;
80
83
return ;
You can’t perform that action at this time.
0 commit comments