From 2e7d0ba59783d71e64b3e3d594d9e331b36f204d Mon Sep 17 00:00:00 2001 From: Eugene Kuzmenko Date: Fri, 21 Apr 2017 11:36:18 +0200 Subject: [PATCH] [fixed] `React.PropTypes` is deprecated in favor of the `"prop-types"` module --- interfaces/react.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/interfaces/react.js b/interfaces/react.js index 5f0ecb3..a97f98e 100644 --- a/interfaces/react.js +++ b/interfaces/react.js @@ -2,7 +2,16 @@ declare module 'react' { declare function createElement(type: any, props?: Object, ...children: any[]): void; - declare var PropTypes: { + declare class Component {} + declare class PureComponent {} +} + +declare module 'react/lib/shallowCompare' { + declare function exports(component: any, props: Object, state: Object): boolean; +} + +declare module 'prop-types' { + declare var exports: { instanceOf(obj: any): void; arrayOf(obj: any): void; oneOfType(types: any[]): void; @@ -14,10 +23,4 @@ declare module 'react' { number: {isRequired: void}; func: {isRequired: void}; }; - declare class Component {} - declare class PureComponent {} -} - -declare module 'react/lib/shallowCompare' { - declare function exports(component: any, props: Object, state: Object): boolean; }