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](b1e49832ef/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
This commit is contained in:
Paul O’Shannessy 2016-07-21 09:01:07 -07:00 committed by Facebook Github Bot 6
parent b8576312ca
commit 5db5ee9f55
4 changed files with 18 additions and 5 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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
);
};
}

View File

@ -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"
}
}