File tree Expand file tree Collapse file tree 5 files changed +63
-4
lines changed
.changeset/little-scissors-bow Expand file tree Collapse file tree 5 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "releases" : [
3+ { "name" : " extract-react-types" , "type" : " patch" },
4+ { "name" : " extract-react-types-loader" , "type" : " patch" },
5+ { "name" : " kind2string" , "type" : " patch" },
6+ { "name" : " pretty-proptypes" , "type" : " patch" }
7+ ],
8+ "dependents" : []
9+ }
Original file line number Diff line number Diff line change 1+ Remove dangerous debug code that broke everything
Original file line number Diff line number Diff line change @@ -4970,6 +4970,41 @@ Object {
49704970}
49714971` ;
49724972
4973+ exports [` typescript React.ComponentType 1` ] = `
4974+ Object {
4975+ " component" : Object {
4976+ " kind" : " generic" ,
4977+ " name" : Object {
4978+ " kind" : " id" ,
4979+ " name" : " Component" ,
4980+ " type" : null ,
4981+ },
4982+ " value" : Object {
4983+ " kind" : " object" ,
4984+ " members" : Array [
4985+ Object {
4986+ " key" : Object {
4987+ " kind" : " id" ,
4988+ " name" : " children" ,
4989+ },
4990+ " kind" : " property" ,
4991+ " optional" : false ,
4992+ " value" : Object {
4993+ " kind" : " generic" ,
4994+ " value" : Object {
4995+ " kind" : " id" ,
4996+ " name" : " React.ComponentType" ,
4997+ },
4998+ },
4999+ },
5000+ ],
5001+ " referenceIdName" : " Props" ,
5002+ },
5003+ },
5004+ " kind" : " program" ,
5005+ }
5006+ ` ;
5007+
49735008exports [` typescript indexed imported type 1` ] = `
49745009Object {
49755010 " component" : Object {
Original file line number Diff line number Diff line change @@ -798,10 +798,9 @@ converters.Identifier = (path, context): K.Id => {
798798 }
799799
800800 if ( bindingPath ) {
801- if ( name === 'SomethingId' )
802- if ( bindingPath . kind === 'module' ) {
803- bindingPath = bindingPath . path ;
804- }
801+ if ( bindingPath . kind === 'module' ) {
802+ bindingPath = bindingPath . path ;
803+ }
805804
806805 // If path is a descendant of bindingPath and share the same name, this is a recursive type.
807806 if ( path . isDescendant ( bindingPath ) && bindingPath . get ( 'id' ) . node . name === name ) {
Original file line number Diff line number Diff line change @@ -408,6 +408,21 @@ const TESTS = [
408408 }
409409 `
410410 } ,
411+ {
412+ name : 'typescript React.ComponentType' ,
413+ typeSystem : 'typescript' ,
414+ code : `
415+ import React from 'react';
416+
417+ type Props = {
418+ children: React.ComponentType,
419+ };
420+
421+ class Component extends React.Component<Props> {
422+
423+ }
424+ `
425+ } ,
411426 {
412427 name : 'ts custom prop' ,
413428 typeSystem : 'typescript' ,
You can’t perform that action at this time.
0 commit comments