diff --git a/packages/plugin-react/src/fast-refresh.ts b/packages/plugin-react/src/fast-refresh.ts index 6e5019d1e059df..b3b095a65cf2ae 100644 --- a/packages/plugin-react/src/fast-refresh.ts +++ b/packages/plugin-react/src/fast-refresh.ts @@ -92,6 +92,7 @@ export function isRefreshBoundary(ast: t.File): boolean { } const { declaration, specifiers } = node if (declaration) { + if (declaration.type === 'ClassDeclaration') return false if (declaration.type === 'VariableDeclaration') { return declaration.declarations.every((variable) => isComponentLikeIdentifier(variable.id)