File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change 1- type types = [
2- React . ElementType ,
3- React . ComponentType ,
4- React . JSXElementConstructor < {
5- prop1 : string ;
6- } >
7- ] ;
1+ type types = [ React . ElementType , React . ComponentType ] ;
82
93/**
104 * ElementType
@@ -20,13 +14,13 @@ export type Example = React.ElementType<{
2014} > ;
2115
2216/**
23- * JSXElementConstructor
17+ * ComponentType
2418 */
25- const Example1 = ( props : { prop1 : string } ) => {
19+ const FuncComponent = ( props : { prop1 : string } ) => {
2620 return null ;
2721} ;
2822
29- class Example2 extends React . Component < {
23+ class ClassComponent extends React . Component < {
3024 prop1 : string ;
3125} > {
3226 render ( ) : React . ReactNode {
@@ -35,13 +29,7 @@ class Example2 extends React.Component<{
3529 }
3630}
3731
38- const tests : Array <
39- React . JSXElementConstructor < {
40- prop1 : string ;
41- } >
42- > = [ Example1 , Example2 ] ;
43-
4432const tests2 : Array < React . ComponentType < { prop1 : string } > > = [
45- Example1 ,
46- Example2 ,
33+ FuncComponent ,
34+ ClassComponent ,
4735] ;
You can’t perform that action at this time.
0 commit comments