@@ -681,22 +681,14 @@ converters.Identifier = (path, context): K.Id => {
681
681
? convert ( path . get ( 'typeAnnotation' ) , { ...context , mode : 'type' } )
682
682
: null ;
683
683
684
- return {
685
- kind : 'id' ,
686
- name,
687
- type
688
- } ;
684
+ return { kind : 'id' , name, type } ;
689
685
}
690
686
} else if ( kind === 'static' || kind === 'binding' ) {
691
687
const type = path . node . typeAnnotation
692
688
? convert ( path . get ( 'typeAnnotation' ) , { ...context , mode : 'type' } )
693
689
: null ;
694
690
695
- return {
696
- kind : 'id' ,
697
- name,
698
- type
699
- } ;
691
+ return { kind : 'id' , name, type } ;
700
692
} else {
701
693
throw new Error ( `Unable to resolve path for: ${ kind } ` ) ;
702
694
}
@@ -720,10 +712,7 @@ converters.Identifier = (path, context): K.Id => {
720
712
721
713
let tsBinding = getTypeBinding ( path , name ) ;
722
714
if ( ! tsBinding ) {
723
- return {
724
- kind : 'id' ,
725
- name
726
- } ;
715
+ return { kind : 'id' , name } ;
727
716
}
728
717
bindingPath = tsBinding . path . parentPath ;
729
718
} else {
@@ -1378,25 +1367,25 @@ function exportedComponents(programPath, componentsToFind: 'all' | 'default', co
1378
1367
1379
1368
if ( isMemo || isForwardRef ) {
1380
1369
// Props typed via generics
1381
- const genericTypeParams = path . get ( 'typeParameters' ) ;
1370
+ const genericParams = path . get ( 'typeParameters' ) ;
1382
1371
1383
1372
// Props are the second type arg
1384
- if ( isForwardRef && genericTypeParams . node ) {
1373
+ if ( isForwardRef && genericParams . node ) {
1385
1374
const component = convertReactComponentFunction (
1386
- genericTypeParams ,
1375
+ genericParams ,
1387
1376
context ,
1388
- genericTypeParams . get ( 'params.1' )
1377
+ genericParams . get ( 'params.1' )
1389
1378
) ;
1390
1379
1391
1380
components . push ( { name, path, component } ) ;
1392
1381
return ;
1393
1382
}
1394
1383
1395
- if ( isMemo && genericTypeParams . node ) {
1384
+ if ( isMemo && genericParams . node ) {
1396
1385
const component = convertReactComponentFunction (
1397
- genericTypeParams ,
1386
+ genericParams ,
1398
1387
context ,
1399
- genericTypeParams . get ( 'params.0' )
1388
+ genericParams . get ( 'params.0' )
1400
1389
) ;
1401
1390
1402
1391
components . push ( { name, path, component } ) ;
@@ -1417,17 +1406,17 @@ function exportedComponents(programPath, componentsToFind: 'all' | 'default', co
1417
1406
return ;
1418
1407
}
1419
1408
1420
- const genericTypeParamsTEMP = firstArg . get ( 'typeParameters' ) ;
1409
+ const firstArgGenericParams = firstArg . get ( 'typeParameters' ) ;
1421
1410
1422
1411
if (
1423
1412
isMemo &&
1424
1413
isSpecialReactComponentType ( firstArg , 'forwardRef' ) &&
1425
- genericTypeParamsTEMP . node
1414
+ firstArgGenericParams . node
1426
1415
) {
1427
1416
const component = convertReactComponentFunction (
1428
- genericTypeParams ,
1417
+ firstArgGenericParams ,
1429
1418
context ,
1430
- genericTypeParamsTEMP . get ( 'params.1' )
1419
+ firstArgGenericParams . get ( 'params.1' )
1431
1420
) ;
1432
1421
1433
1422
components . push ( { name, path, component } ) ;
0 commit comments