Skip to content

Commit 1f5edce

Browse files
authored
Merge pull request #2 from ddouglasz/provision-for-forward-ref
Allow components using forwardRef
2 parents 52e48ce + 4b72131 commit 1f5edce

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ function checkForProptypes(path, paramTypeName) {
4747
}
4848

4949
function setParamsTypeDefinitionFromFunctionType(documentation, path) {
50-
if (path.parentPath.node.init && path.parentPath.node.init.params.length === 0) {
50+
if (
51+
path.parentPath.node.init &&
52+
Array.isArray(path.parentPath.node.init.params) &&
53+
path.parentPath.node.init.params.length === 0
54+
)
55+
{
5156
return;
52-
}
53-
57+
}
58+
5459
if (
5560
path.node.type === 'ArrowFunctionExpression' &&
5661
(

0 commit comments

Comments
 (0)