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(
7070 if ( index !== null ) {
7171 // Obtain the BOUND update method at the given index
7272 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+ }
7881 // Iterate through new children after state has been set
7982 targetSnapshot . children . forEach ( ( child ) => updateReactFiberTree ( child , circularComponentTable ) ) ;
8083 return ;
You can’t perform that action at this time.
0 commit comments