[babel] Lookup magic prop directly

This commit is contained in:
Sathya Gunasekaran
2023-08-10 13:31:46 -04:00
parent c1c35407ba
commit e70dfbb5a4
@@ -330,7 +330,9 @@ function shouldVisitNode(
pass: CompilerPass
): boolean {
if (pass.opts.enableOnlyOnReactScript) {
if (!fn.get("__componentDeclaration")) {
// Typescript gets angry about lookup the magic prop
let fnAny = fn as any;
if (!fnAny.node.__componentDeclaration) {
return false;
}
}