Skip to content

Commit 6560991

Browse files
authored
Update statePropExtractors.ts
Got rid of redundant notes
1 parent 51c8de6 commit 6560991

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/backend/controllers/statePropExtractors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,13 @@ export function getHooksNames(elementType: string): { hookName: string; varName:
123123
reactHook = expression[1].property?.name;
124124
if (reactHook === 'useState') {
125125
// Obtain the variable being set:
126-
//This points to second to last element of declarations because webpack adds an extra variable when converting files that use ES6, so the previous pointer wasn't working for this case
127126
let varName: string =
128127
// Points to second to last element of declarations because webpack adds an extra variable when converting files that use ES6
129128
declarations[declarations.length - 2]?.id?.name || // work react application;
130129
(Array.isArray(declarations[0]?.id?.elements)
131130
? declarations[0]?.id?.elements[0]?.name
132131
: undefined); //work for nextJS application
133132
// Obtain the setState method:
134-
//This points to last element of declarations because webpack adds an extra variable when converting files that use ES6, so the previous pointer wasn't working for this case
135133
let hookName: string =
136134
//Points to last element of declarations because webpack adds an extra variable when converting files that use ES6
137135
declarations[declarations.length - 1]?.id?.name || // work react application;

0 commit comments

Comments
 (0)