@@ -20,6 +20,7 @@ import {
20
20
import Tree from './tree' ;
21
21
import componentActionsRecord from './masterState' ;
22
22
import { throttle , getHooksNames } from './helpers' ;
23
+ import { Console } from 'console' ;
23
24
24
25
// Set global variables to use in exported module and helper functions
25
26
declare global {
@@ -197,33 +198,18 @@ function createTree(
197
198
currentFiber . memoizedState . next . memoizedState &&
198
199
currentFiber . memoizedState . next . memoizedState . deps
199
200
) {
200
- let pointer = currentFiber . memoizedState . next ) ;
201
-
201
+
202
+ let pointer = currentFiber . memoizedState . next ;
202
203
while ( pointer !== null ) {
203
204
if ( ! Array . isArray ( pointer . memoizedState ) ) {
204
- console . log ( pointer )
205
+ let componentName = currentFiber . elementType . name
206
+ let atomName = pointer . memoizedState . deps [ 0 ] [ 'key' ]
207
+ allAtomsRelationship . push ( [ atomName , componentName , 'atoms and components' ] ) ;
205
208
}
206
209
pointer = pointer . next
207
210
}
208
211
}
209
212
210
- // if (elementType?.name && isRecoil) {
211
- // let pointer = memoizedState;
212
- // while (pointer !== null && pointer !== undefined && pointer.next !== null) {
213
- // pointer = pointer.next;
214
- // }
215
-
216
- // if (pointer?.memoizedState[1]?.[0].current) {
217
- // const atomName = pointer.memoizedState[1]?.[0].current.keys().next().value;
218
- // allAtomsRelationship.push([atomName, elementType?.name, 'atoms and components']);
219
- // }
220
-
221
- // if (pointer?.memoizedState[1]?.[0].key) {
222
- // const atomName = pointer.memoizedState[1]?.[0].key;
223
- // allAtomsRelationship.push([atomName, elementType?.name, 'atoms and components']);
224
- // }
225
- // }
226
-
227
213
let newState : any | { hooksState ?: any [ ] } = { } ;
228
214
let componentData : {
229
215
hooksState ?: any [ ] ;
0 commit comments