We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4063095 commit 5389cb4Copy full SHA for 5389cb4
packages/babel-plugin-component-annotate/src/index.ts
@@ -447,8 +447,8 @@ function collectFragmentContext(programPath: Babel.NodePath): FragmentContext {
447
if (source === "react" || source === "React") {
448
importPath.node.specifiers.forEach((spec) => {
449
if (spec.type === "ImportSpecifier" && spec.imported.type === "Identifier") {
450
- // import { Fragment } from 'react' -> Fragment
451
- // import { Fragment as F } from 'react' -> F
+ // Detect aliased React.Fragment imports (e.g., `Fragment as F`)
+ // so we can later identify <F> as a fragment in JSX.
452
if (spec.imported.name === "Fragment") {
453
fragmentAliases.add(spec.local.name);
454
}
0 commit comments