Skip to content

Commit

Permalink
fix: don't count class declarations as react fast refresh boundry (fi…
Browse files Browse the repository at this point in the history
…xes #3675) (#8887)
  • Loading branch information
DouglasDev committed Aug 10, 2022
1 parent e8b61bb commit 5a18284
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/plugin-react/src/fast-refresh.ts
Expand Up @@ -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)
Expand Down

0 comments on commit 5a18284

Please sign in to comment.