mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
[babel] Lookup magic prop directly
This commit is contained in:
1 parent
c1c35407ba
commit
e70dfbb5a4
1 file changed
+3
-1
@@ -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