浏览代码

Start the switch to prop-types

As https://facebook.github.io/react/docs/typechecking-with-proptypes.html
says, React.PropTypes have moved into the npm package prop-types since
React v15.5. I've already failed to update certain devDependencies
because they mandate the use of prop-types so I'd rather we (gradually
at least) move to prop-types rather than face a lot of work later on.
j8
Lyubo Marinov 8 年前
父节点
当前提交
571958cf26
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 1
    0
      package.json
  2. 6
    5
      react/features/app/components/AbstractApp.js

+ 1
- 0
package.json 查看文件

@@ -51,6 +51,7 @@
51 51
     "lodash": "4.17.4",
52 52
     "nuclear-js": "1.4.0",
53 53
     "postis": "2.2.0",
54
+    "prop-types": "15.5.10",
54 55
     "react": "15.6.1",
55 56
     "react-dom": "15.6.1",
56 57
     "react-i18next": "4.8.0",

+ 6
- 5
react/features/app/components/AbstractApp.js 查看文件

@@ -1,3 +1,4 @@
1
+import PropTypes from 'prop-types';
1 2
 import React, { Component } from 'react';
2 3
 import { I18nextProvider } from 'react-i18next';
3 4
 import { Provider } from 'react-redux';
@@ -39,19 +40,19 @@ export class AbstractApp extends Component {
39 40
          * The default URL {@code AbstractApp} is to open when not in any
40 41
          * conference/room.
41 42
          */
42
-        defaultURL: React.PropTypes.string,
43
+        defaultURL: PropTypes.string,
43 44
 
44 45
         /**
45 46
          * (Optional) redux store for this app.
46 47
          */
47
-        store: React.PropTypes.object,
48
+        store: PropTypes.object,
48 49
 
49 50
         /**
50 51
          * The URL, if any, with which the app was launched.
51 52
          */
52
-        url: React.PropTypes.oneOfType([
53
-            React.PropTypes.object,
54
-            React.PropTypes.string
53
+        url: PropTypes.oneOfType([
54
+            PropTypes.object,
55
+            PropTypes.string
55 56
         ])
56 57
     };
57 58
 

正在加载...
取消
保存