@@ -13,7 +13,8 @@ module.exports = (snap, mode) => {
13
13
14
14
function sendSnapshot ( ) {
15
15
// don't send messages while jumping or while paused
16
- // DEV: So that when we are jumping to an old snapshot it wouldn't think we want to create new snapshots
16
+ // DEV: So that when we are jumping to an old snapshot it
17
+ // wouldn't think we want to create new snapshots
17
18
if ( mode . jumping || mode . paused ) return ;
18
19
const payload = snap . tree . getCopy ( ) ;
19
20
// console.log('payload', payload);
@@ -83,7 +84,7 @@ module.exports = (snap, mode) => {
83
84
84
85
function createTree ( currentFiber , tree = new Tree ( 'root' ) ) {
85
86
if ( ! currentFiber ) return tree ;
86
-
87
+
87
88
const {
88
89
sibling,
89
90
stateNode,
@@ -103,9 +104,9 @@ module.exports = (snap, mode) => {
103
104
// Check if the component uses hooks
104
105
if ( memoizedState && Object . hasOwnProperty . call ( memoizedState , 'baseState' ) ) {
105
106
// Traverse through the currentFiber and extract the getters/setters
106
- astHooks = astParser ( elementType ) ;
107
- saveState ( astHooks ) ;
108
- // Create a traversed property and assign to the evaluated result of
107
+ astHooks = astParser ( elementType ) ;
108
+ saveState ( astHooks ) ;
109
+ // Create a traversed property and assign to the evaluated result of
109
110
// invoking traverseHooks with memoizedState
110
111
memoizedState . traversed = traverseHooks ( memoizedState ) ;
111
112
nextTree = tree . appendChild ( memoizedState ) ;
@@ -131,7 +132,7 @@ module.exports = (snap, mode) => {
131
132
} = container ;
132
133
// only assign internal rootp if it actually exists
133
134
fiberRoot = _internalRoot || _reactRootContainer ;
134
-
135
+
135
136
updateSnapShotTree ( ) ;
136
137
// send the initial snapshot once the content script has started up
137
138
window . addEventListener ( 'message' , ( { data : { action } } ) => {
@@ -145,5 +146,5 @@ module.exports = (snap, mode) => {
145
146
// return getNextImport('./UseStateHook');
146
147
// return 'Testing outside';
147
148
// const OtherComponent = loadable(() => import('./OtherComponent'))
148
- }
149
- } ;
149
+ } ;
150
+ } ;
0 commit comments