Quellcode durchsuchen

Replace React.PropTypes with prop-types (#1373)

React is now migrating away from React.PropTypes starting from v15.5.0
More info:
https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html
Elaine N Hilliard vor 7 Jahren
Ursprung
Commit
74266b05eb

+ 2
- 1
example/src/components/Row.js Datei anzeigen

@@ -1,4 +1,5 @@
1
-import React, { PropTypes } from 'react';
1
+import React from 'react';
2
+import PropTypes from 'prop-types';
2 3
 import { StyleSheet, View, Text, TouchableHighlight, Platform } from 'react-native';
3 4
 
4 5
 function Row({ title, onPress, platform, testID }) {

+ 1
- 1
old-example-redux/src/screens/BottomTabsSideMenu.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   View,

+ 1
- 1
old-example-redux/src/screens/FirstTabScreen.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   View,

+ 1
- 1
old-example-redux/src/screens/ListScreen.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   View,

+ 2
- 1
old-example-redux/src/screens/LoginScreen.js Datei anzeigen

@@ -1,4 +1,5 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2
+import PropTypes from 'prop-types';
2 3
 import {
3 4
   Text,
4 5
   View,

+ 1
- 1
old-example-redux/src/screens/PushedScreen.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   View,

+ 1
- 1
old-example-redux/src/screens/SecondTabScreen.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   Image,

+ 1
- 1
old-example-redux/src/screens/SideMenu.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2 2
 import {
3 3
   Text,
4 4
   View,

+ 1
- 0
package.json Datei anzeigen

@@ -51,6 +51,7 @@
51 51
     "jest": "18.x.x",
52 52
     "jest-cli": "18.x.x",
53 53
     "jest-react-native": "18.x.x",
54
+    "prop-types": "^15.5.10",
54 55
     "react": "16.0.0-alpha.6",
55 56
     "react-native": "0.43.0",
56 57
     "react-test-renderer": "15.4.2",

+ 2
- 1
src/views/sharedElementTransition.ios.js Datei anzeigen

@@ -1,4 +1,5 @@
1
-import React, {Component, PropTypes} from 'react';
1
+import React, {Component} from 'react';
2
+import PropTypes from 'prop-types';
2 3
 import {
3 4
   View
4 5
 } from 'react-native';

+ 8
- 1
yarn.lock Datei anzeigen

@@ -2986,7 +2986,7 @@ longest@^1.0.1:
2986 2986
   version "1.0.1"
2987 2987
   resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
2988 2988
 
2989
-loose-envify@^1.0.0, loose-envify@^1.1.0:
2989
+loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
2990 2990
   version "1.3.1"
2991 2991
   resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
2992 2992
   dependencies:
@@ -3489,6 +3489,13 @@ promise@^7.1.1:
3489 3489
   dependencies:
3490 3490
     asap "~2.0.3"
3491 3491
 
3492
+prop-types@^15.5.10:
3493
+  version "15.5.10"
3494
+  resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
3495
+  dependencies:
3496
+    fbjs "^0.8.9"
3497
+    loose-envify "^1.3.1"
3498
+
3492 3499
 prr@~0.0.0:
3493 3500
   version "0.0.0"
3494 3501
   resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"