Skip to content
This repository was archived by the owner on Jul 9, 2021. It is now read-only.

Commit 2e7d0ba

Browse files
committed
[fixed] React.PropTypes is deprecated in favor of the "prop-types" module
1 parent edaa3ef commit 2e7d0ba

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

interfaces/react.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
declare module 'react' {
44
declare function createElement(type: any, props?: Object, ...children: any[]): void;
5-
declare var PropTypes: {
5+
declare class Component {}
6+
declare class PureComponent {}
7+
}
8+
9+
declare module 'react/lib/shallowCompare' {
10+
declare function exports(component: any, props: Object, state: Object): boolean;
11+
}
12+
13+
declare module 'prop-types' {
14+
declare var exports: {
615
instanceOf(obj: any): void;
716
arrayOf(obj: any): void;
817
oneOfType(types: any[]): void;
@@ -14,10 +23,4 @@ declare module 'react' {
1423
number: {isRequired: void};
1524
func: {isRequired: void};
1625
};
17-
declare class Component {}
18-
declare class PureComponent {}
19-
}
20-
21-
declare module 'react/lib/shallowCompare' {
22-
declare function exports(component: any, props: Object, state: Object): boolean;
2326
}

0 commit comments

Comments
 (0)