File tree Expand file tree Collapse file tree 5 files changed +92
-0
lines changed Expand file tree Collapse file tree 5 files changed +92
-0
lines changed Original file line number Diff line number Diff line change @@ -1465,3 +1465,54 @@ Object {
14651465 },
14661466}
14671467` ;
1468+
1469+ exports [` main fixtures processes component "component_29.js" without errors 1` ] = `
1470+ Object {
1471+ " description" : " " ,
1472+ " displayName" : " MyComponent" ,
1473+ " methods" : Array [],
1474+ " props" : Object {
1475+ " prop" : Object {
1476+ " description" : " " ,
1477+ " flowType" : Object {
1478+ " name" : " T" ,
1479+ },
1480+ " required" : true ,
1481+ },
1482+ },
1483+ }
1484+ ` ;
1485+
1486+ exports [` main fixtures processes component "component_30.js" without errors 1` ] = `
1487+ Object {
1488+ " description" : " " ,
1489+ " displayName" : " MyComponent" ,
1490+ " methods" : Array [],
1491+ " props" : Object {
1492+ " prop" : Object {
1493+ " description" : " " ,
1494+ " flowType" : Object {
1495+ " name" : " string" ,
1496+ },
1497+ " required" : true ,
1498+ },
1499+ },
1500+ }
1501+ ` ;
1502+
1503+ exports [` main fixtures processes component "component_31.js" without errors 1` ] = `
1504+ Object {
1505+ " description" : " " ,
1506+ " displayName" : " MyComponent" ,
1507+ " methods" : Array [],
1508+ " props" : Object {
1509+ " prop" : Object {
1510+ " description" : " " ,
1511+ " flowType" : Object {
1512+ " name" : " T" ,
1513+ },
1514+ " required" : true ,
1515+ },
1516+ },
1517+ }
1518+ ` ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ type Identity < T > = T ;
4+
5+ type Props < T > = {
6+ prop : Identity < T > ,
7+ }
8+
9+ export default function MyComponent < T > (props: Props< T > ) {
10+ return < div > Hello World < / d i v >
11+ }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ type Identity < T > = T ;
4+
5+ type Props = {
6+ prop : Identity < string > ,
7+ }
8+
9+ export default function MyComponent ( props : Props ) {
10+ return < div > Hello World</ div >
11+ }
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+
3+ type Identity < T > = T ;
4+
5+ type Props < T > = {
6+ prop : Identity < Identity < T >> ,
7+ }
8+
9+ export default function MyComponent < T > (props: Props< T > ) {
10+ return < div > Hello World < / d i v >
11+ }
Original file line number Diff line number Diff line change @@ -139,6 +139,14 @@ function handleGenericTypeAnnotation(
139139 ) ;
140140 }
141141
142+ if (
143+ typeParams &&
144+ typeParams [ type . name ] &&
145+ typeParams [ type . name ] . value . type === t . GenericTypeAnnotation . name
146+ ) {
147+ return type ;
148+ }
149+
142150 if ( typeParams && typeParams [ type . name ] ) {
143151 type = getFlowTypeWithResolvedTypes ( resolvedPath , typeParams ) ;
144152 }
You can’t perform that action at this time.
0 commit comments