From 5db5ee9f556ee0486f4e805425807fc74e23a9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 21 Jul 2016 09:01:07 -0700 Subject: [PATCH] Upgrade to React v15.3.0-rc.2 Summary: There were several fixes to how calls to propType checkers. This is to account for the new deprecation warning - React.PropTypes will not be part of production builds in the future. Note: There is still a warning about an invalid argument to `React.PropTypes.oneOf` (React is running that validation sooner now). Specifically [both of these](https://github.com/facebook/react-native/blob/b1e49832ef3f9ffb0e5da2da7f847a8fae1d9c35/Libraries/Components/Touchable/TouchableWithoutFeedback.js#L44-L45) because `View.AccessibilityTraits` is actually undefined in tests (didn't look into why you conditionally set that). **Test plan (required)** `npm test` & fixed all warnings due to proptype secret Closes https://github.com/facebook/react-native/pull/8758 Reviewed By: zpao Differential Revision: D3564288 Pulled By: bestander fbshipit-source-id: 1ff1f90907f41855e364048aa730ccd239c522b4 --- Libraries/StyleSheet/StyleSheetValidation.js | 5 ++++- Libraries/Utilities/createStrictShapeTypeChecker.js | 3 ++- Libraries/Utilities/deprecatedPropType.js | 11 ++++++++++- package.json | 4 ++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Libraries/StyleSheet/StyleSheetValidation.js b/Libraries/StyleSheet/StyleSheetValidation.js index 99cc380df..259dd558b 100644 --- a/Libraries/StyleSheet/StyleSheetValidation.js +++ b/Libraries/StyleSheet/StyleSheetValidation.js @@ -13,6 +13,7 @@ var ImageStylePropTypes = require('ImageStylePropTypes'); var ReactPropTypeLocations = require('react/lib/ReactPropTypeLocations'); +var ReactPropTypesSecret = require('react/lib/ReactPropTypesSecret'); var TextStylePropTypes = require('TextStylePropTypes'); var ViewStylePropTypes = require('ViewStylePropTypes'); @@ -33,7 +34,9 @@ class StyleSheetValidation { style, prop, caller, - ReactPropTypeLocations.prop + ReactPropTypeLocations.prop, + null, + ReactPropTypesSecret ); if (error) { styleError(error.message, style, caller); diff --git a/Libraries/Utilities/createStrictShapeTypeChecker.js b/Libraries/Utilities/createStrictShapeTypeChecker.js index 710de6a54..d86ce5942 100644 --- a/Libraries/Utilities/createStrictShapeTypeChecker.js +++ b/Libraries/Utilities/createStrictShapeTypeChecker.js @@ -12,6 +12,7 @@ 'use strict'; var ReactPropTypeLocationNames = require('react/lib/ReactPropTypeLocationNames'); +var ReactPropTypesSecret = require('react/lib/ReactPropTypesSecret'); var invariant = require('fbjs/lib/invariant'); var merge = require('merge'); @@ -54,7 +55,7 @@ function createStrictShapeTypeChecker( `\nValid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } - var error = checker(propValue, key, componentName, location); + var error = checker(propValue, key, componentName, location, null, ReactPropTypesSecret); if (error) { invariant( false, diff --git a/Libraries/Utilities/deprecatedPropType.js b/Libraries/Utilities/deprecatedPropType.js index 63bc61020..8bdcae77d 100644 --- a/Libraries/Utilities/deprecatedPropType.js +++ b/Libraries/Utilities/deprecatedPropType.js @@ -12,6 +12,8 @@ 'use strict'; const UIManager = require('UIManager'); +const ReactPropTypesSecret = require('react/lib/ReactPropTypesSecret'); +const ReactPropTypeLocations = require('react/lib/ReactPropTypeLocations'); /** * Adds a deprecation warning when the prop is used. @@ -26,7 +28,14 @@ function deprecatedPropType( console.warn(`\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`); } - return propType(props, propName, componentName); + return propType( + props, + propName, + componentName, + ReactPropTypeLocations.prop, + null, + ReactPropTypesSecret + ); }; } diff --git a/package.json b/package.json index c958245ec..b34eda1f7 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "react-native": "local-cli/wrong-react-native.js" }, "peerDependencies": { - "react": "~15.2.1" + "react": "~15.3.0-rc.2" }, "dependencies": { "absolute-path": "^0.0.0", @@ -203,7 +203,7 @@ "jest-repl": "^13.1.0", "jest-runtime": "^13.1.0", "portfinder": "0.4.0", - "react": "~15.2.1", + "react": "~15.3.0-rc.2", "shelljs": "0.6.0" } }