Skip to content

Commit 236276b

Browse files
committed
fix(injector): don't visit FunctionDeclarations more than once
1 parent 3a40065 commit 236276b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: src/injector.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,8 @@ function plugin(propTypes: t.ProgramNode, options: InjectOptions = {}): babel.Pl
103103
needImport = true;
104104

105105
// Prevent visiting again
106-
if ((node as any).hasBeenVisited) {
107-
path.skip();
108-
return;
109-
}
106+
(node as any).hasBeenVisited = true;
107+
path.skip();
110108

111109
injectPropTypes({
112110
nodeName: node.id.name,

0 commit comments

Comments
 (0)