diff --git a/compiler/forget/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts b/compiler/forget/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts index b62f707340..1b707f80f5 100644 --- a/compiler/forget/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts +++ b/compiler/forget/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts @@ -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; } }