Skip to content

Commit 5389cb4

Browse files
Update comment for clarity
Co-authored-by: LucasZF <[email protected]>
1 parent 4063095 commit 5389cb4

File tree

1 file changed

+2
-2
lines changed
  • packages/babel-plugin-component-annotate/src

1 file changed

+2
-2
lines changed

packages/babel-plugin-component-annotate/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ function collectFragmentContext(programPath: Babel.NodePath): FragmentContext {
447447
if (source === "react" || source === "React") {
448448
importPath.node.specifiers.forEach((spec) => {
449449
if (spec.type === "ImportSpecifier" && spec.imported.type === "Identifier") {
450-
// import { Fragment } from 'react' -> Fragment
451-
// import { Fragment as F } from 'react' -> F
450+
// Detect aliased React.Fragment imports (e.g., `Fragment as F`)
451+
// so we can later identify <F> as a fragment in JSX.
452452
if (spec.imported.name === "Fragment") {
453453
fragmentAliases.add(spec.local.name);
454454
}

0 commit comments

Comments
 (0)