Browse Source

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 7 years ago
parent
commit
74266b05eb

+ 2
- 1
example/src/components/Row.js View File

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

+ 1
- 1
old-example-redux/src/screens/BottomTabsSideMenu.js View File

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

+ 1
- 1
old-example-redux/src/screens/FirstTabScreen.js View File

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

+ 1
- 1
old-example-redux/src/screens/ListScreen.js View File

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

+ 2
- 1
old-example-redux/src/screens/LoginScreen.js View File

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

+ 1
- 1
old-example-redux/src/screens/PushedScreen.js View File

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

+ 1
- 1
old-example-redux/src/screens/SecondTabScreen.js View File

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

+ 1
- 1
old-example-redux/src/screens/SideMenu.js View File

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

+ 1
- 0
package.json View File

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

+ 2
- 1
src/views/sharedElementTransition.ios.js View File

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

+ 8
- 1
yarn.lock View File

2986
   version "1.0.1"
2986
   version "1.0.1"
2987
   resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
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
   version "1.3.1"
2990
   version "1.3.1"
2991
   resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
2991
   resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
2992
   dependencies:
2992
   dependencies:
3489
   dependencies:
3489
   dependencies:
3490
     asap "~2.0.3"
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
 prr@~0.0.0:
3499
 prr@~0.0.0:
3493
   version "0.0.0"
3500
   version "0.0.0"
3494
   resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"
3501
   resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a"