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.
1 parent 16879fb commit 283319bCopy full SHA for 283319b
src/backend/helpers.ts
@@ -113,7 +113,7 @@ export const getHooksNames = (elementType: string): Array<string> => {
113
} else {
114
// hook.init.object is '_useState2', '_useState4', etc.
115
// eslint-disable-next-line no-lonely-if
116
- if (hook.init.object && hook.init.object.name) {
+ if (hook?.init?.object?.name) {
117
const varName: any = hook.init.object.name;
118
if (!hooksNames[varName] && varName.match(/_use/)) {
119
hooksNames[varName] = hook.id.name;
0 commit comments