Skip to content

Commit f6dbcbd

Browse files
committed
fix: Fix an empty arrayOf().
1 parent ae1e0f2 commit f6dbcbd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/convertBabelToPropTypes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ function convert(type: any, state: ConvertState, depth: number): PropType | null
115115
if (name === 'Array') {
116116
const args = convertArray([type.typeParameters?.params[0]], state, depth);
117117

118+
if (args.length === 0) {
119+
return null;
120+
}
121+
118122
return createCall(t.identifier('arrayOf'), args, propTypesImportedName);
119123

120124
// node

0 commit comments

Comments
 (0)