File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ module.exports = (snap, mode) => {
121
121
// Save component's state and setState() function to our record for future
122
122
// time-travel state changing. Add record index to snapshot so we can retrieve.
123
123
componentData . index = componentActionsRecord . saveNew ( stateNode . state , stateNode ) ;
124
- newState . state = stateNode . state ;
124
+ newState = stateNode . state ;
125
125
componentFound = true ;
126
126
}
127
127
@@ -148,18 +148,6 @@ module.exports = (snap, mode) => {
148
148
componentFound = true ;
149
149
} ) ;
150
150
}
151
- } else {
152
- console . log ( 'in create tree else' ) ;
153
- console . log ( 'this is currentFiber from createTree' , currentFiber ) ;
154
- console . log ( 'this is memoizedState from createTree' , memoizedState ) ;
155
- // grab stateless components here
156
- if ( elementType ) {
157
- if ( elementType . name ) {
158
- tree . appendChild ( 'stateless' , elementType . name , index ) ;
159
- } else {
160
- tree . appendChild ( 'stateless' , elementType , index ) ;
161
- }
162
- }
163
151
}
164
152
165
153
// This grabs stateless components
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ class Tree {
44
44
} ) ;
45
45
}
46
46
return copy ;
47
+ }
47
48
48
49
// print out the tree structure in the console
49
50
// DEV: Process may be different for useState components
@@ -53,7 +54,8 @@ class Tree {
53
54
// console.log('current tree structure for *this : ', this);
54
55
const children = [ 'children: ' ] ;
55
56
// DEV: What should we push instead for components using hooks (it wouldn't be state)
56
- this . children . forEach ( child => { // if this.children is always initialized to empty array, when would there ever be anything to iterate through here?
57
+ // if this.children is always initialized to empty array, when would there ever be anything to iterate through here?
58
+ this . children . forEach ( child => {
57
59
children . push ( child . state || child . component . state ) ;
58
60
} ) ;
59
61
if ( this . name ) console . log ( 'this.name if exists: ' , this . name ) ;
@@ -66,4 +68,4 @@ class Tree {
66
68
}
67
69
}
68
70
69
- module . exports = Tree
71
+ module . exports = Tree ;
You can’t perform that action at this time.
0 commit comments