This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -92,18 +92,20 @@ function getTypeFromPropType(node: any): string {
92
92
if ( isMemberExpression ( node ) ) {
93
93
const type = convertMemberExpression ( node ) ;
94
94
switch ( type ) {
95
- case 'React.PropTypes.number' :
96
- return 'number' ;
97
- case 'React.PropTypes.string' :
98
- return 'string' ;
95
+ case 'React.PropTypes.any' :
96
+ return 'any' ;
99
97
case 'React.PropTypes.array' :
100
98
return 'any[]' ;
101
99
case 'React.PropTypes.bool' :
102
100
return 'boolean' ;
103
101
case 'React.PropTypes.func' :
104
102
return '(...args: any[]) => any' ;
103
+ case 'React.PropTypes.number' :
104
+ return 'number' ;
105
105
case 'React.PropTypes.object' :
106
106
return 'Object' ;
107
+ case 'React.PropTypes.string' :
108
+ return 'string' ;
107
109
case 'React.PropTypes.node' :
108
110
return 'React.ReactNode' ;
109
111
case 'React.PropTypes.element' :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ declare module 'simple-component' {
2
2
import * as React from 'react' ;
3
3
4
4
interface Props {
5
+ optionalAny ?: any ;
5
6
optionalArray ?: any [ ] ;
6
7
optionalBool ?: boolean ;
7
8
optionalFunc ?: ( ...args : any [ ] ) => any ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as React from 'react';
3
3
export default class SimpleComponent extends React . Component {
4
4
5
5
static propTypes = {
6
+ optionalAny : React . PropTypes . any ,
6
7
optionalArray : React . PropTypes . array ,
7
8
optionalBool : React . PropTypes . bool ,
8
9
optionalFunc : React . PropTypes . func ,
You can’t perform that action at this time.
0 commit comments