From 5da353f26c20264812fc9028c0cc17710591f710 Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Mon, 29 Mar 2021 14:47:36 +0200 Subject: [PATCH] fix: use displayName only for functional components This fixes one of the issues that arise when bumping to vue 3.0.9. There is no change in behavior: it just make TypeScript OK with the recent changes in vue-next. --- src/utils/find.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils/find.ts b/src/utils/find.ts index a60a7fc86..ba82a0d08 100644 --- a/src/utils/find.ts +++ b/src/utils/find.ts @@ -36,9 +36,13 @@ export function matches( } let componentName: string | undefined - if ('name' in nodeType || 'displayName' in nodeType) { - // match normal component definitions or functional components - componentName = nodeType.name || nodeType.displayName + if ('name' in nodeType) { + // match normal component definitions + componentName = nodeType.name + } + if (!componentName && 'displayName' in nodeType) { + // match functional components + componentName = nodeType.displayName } let selectorName = selector.name