We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 30cc177 + 59a7291 commit 6569971Copy full SHA for 6569971
src/backend/helpers.ts
@@ -114,7 +114,7 @@ export const getHooksNames = (elementType: string): Array<string> => {
114
} else {
115
// hook.init.object is '_useState2', '_useState4', etc.
116
// eslint-disable-next-line no-lonely-if
117
- if (hook.init.object?.name) {
+ if (hook?.init?.object?.name) {
118
const varName: any = hook.init.object.name;
119
if (!hooksNames[varName] && varName.match(/_use/)) {
120
hooksNames[varName] = hook.id.name;
0 commit comments