This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree 7 files changed +2287
-12
lines changed
7 files changed +2287
-12
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ function getTypeFromPropType(node: any): string {
104
104
return '(...args: any[]) => any' ;
105
105
case 'React.PropTypes.object' :
106
106
return 'Object' ;
107
+ case 'React.PropTypes.node' :
108
+ return 'React.ReactNode' ;
109
+ case 'React.PropTypes.element' :
110
+ return 'React.ReactElement<any>' ;
107
111
}
108
112
}
109
113
}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ declare module 'simple-component' {
2
2
import * as React from 'react' ;
3
3
4
4
interface Props {
5
- number ?: number ;
6
- string ?: string ;
7
- array ?: any [ ] ;
8
- bool ?: boolean ;
9
- func ?: ( ...args : any [ ] ) => any ;
10
- object ?: Object ;
5
+ optionalArray ?: any [ ] ;
6
+ optionalBool ?: boolean ;
7
+ optionalFunc ?: ( ...args : any [ ] ) => any ;
8
+ optionalNumber ?: number ;
9
+ optionalObject ?: Object ;
10
+ optionalString ?: string ;
11
+ optionalNode ?: React . ReactNode ;
12
+ optionalElement ?: React . ReactElement < any > ;
11
13
}
12
14
13
15
export default class SimpleComponent extends React . Component < Props , any > {
Original file line number Diff line number Diff line change @@ -3,12 +3,14 @@ import * as React from 'react';
3
3
export default class SimpleComponent extends React . Component {
4
4
5
5
static propTypes = {
6
- number : React . PropTypes . number ,
7
- string : React . PropTypes . string ,
8
- array : React . PropTypes . array ,
9
- bool : React . PropTypes . bool ,
10
- func : React . PropTypes . func ,
11
- object : React . PropTypes . object
6
+ optionalArray : React . PropTypes . array ,
7
+ optionalBool : React . PropTypes . bool ,
8
+ optionalFunc : React . PropTypes . func ,
9
+ optionalNumber : React . PropTypes . number ,
10
+ optionalObject : React . PropTypes . object ,
11
+ optionalString : React . PropTypes . string ,
12
+ optionalNode : React . PropTypes . node ,
13
+ optionalElement : React . PropTypes . element ,
12
14
} ;
13
15
14
16
render ( ) {
Original file line number Diff line number Diff line change 7
7
"installed" : {
8
8
"node/node.d.ts" : {
9
9
"commit" : " 4910a7c52a1cf335877ea3b0917eb65117a66637"
10
+ },
11
+ "react/react.d.ts" : {
12
+ "commit" : " 715df764419937a75a25dcd76bfc954157bc7b96"
10
13
}
11
14
}
12
15
}
You can’t perform that action at this time.
0 commit comments