Skip to content

Commit

Permalink
fix(transformer/react): don't transform declaration of function overl…
Browse files Browse the repository at this point in the history
…oads
  • Loading branch information
Dunqing committed Sep 9, 2024
1 parent 39d81a1 commit a4e0c52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_transformer/src/react/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ impl<'a> ReactRefresh<'a> {
}
ExportDefaultDeclarationKind::FunctionDeclaration(func) => {
if let Some(id) = &func.id {
if !is_componentish_name(&id.name) {
if func.is_typescript_syntax() || !is_componentish_name(&id.name) {
return None;
}

Expand All @@ -812,7 +812,7 @@ impl<'a> ReactRefresh<'a> {
return None;
};

if !is_componentish_name(&id.name) {
if func.is_typescript_syntax() || !is_componentish_name(&id.name) {
return None;
}

Expand Down

0 comments on commit a4e0c52

Please sign in to comment.