mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[babel] Lookup magic prop directly
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user