mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
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:
committed by
Facebook Github Bot 6
parent
b8576312ca
commit
5db5ee9f55
@@ -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,
|
||||
|
||||
@@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user