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:
parent
b8576312ca
commit
5db5ee9f55
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
var ImageStylePropTypes = require('ImageStylePropTypes');
|
var ImageStylePropTypes = require('ImageStylePropTypes');
|
||||||
var ReactPropTypeLocations = require('react/lib/ReactPropTypeLocations');
|
var ReactPropTypeLocations = require('react/lib/ReactPropTypeLocations');
|
||||||
|
var ReactPropTypesSecret = require('react/lib/ReactPropTypesSecret');
|
||||||
var TextStylePropTypes = require('TextStylePropTypes');
|
var TextStylePropTypes = require('TextStylePropTypes');
|
||||||
var ViewStylePropTypes = require('ViewStylePropTypes');
|
var ViewStylePropTypes = require('ViewStylePropTypes');
|
||||||
|
|
||||||
|
@ -33,7 +34,9 @@ class StyleSheetValidation {
|
||||||
style,
|
style,
|
||||||
prop,
|
prop,
|
||||||
caller,
|
caller,
|
||||||
ReactPropTypeLocations.prop
|
ReactPropTypeLocations.prop,
|
||||||
|
null,
|
||||||
|
ReactPropTypesSecret
|
||||||
);
|
);
|
||||||
if (error) {
|
if (error) {
|
||||||
styleError(error.message, style, caller);
|
styleError(error.message, style, caller);
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var ReactPropTypeLocationNames = require('react/lib/ReactPropTypeLocationNames');
|
var ReactPropTypeLocationNames = require('react/lib/ReactPropTypeLocationNames');
|
||||||
|
var ReactPropTypesSecret = require('react/lib/ReactPropTypesSecret');
|
||||||
|
|
||||||
var invariant = require('fbjs/lib/invariant');
|
var invariant = require('fbjs/lib/invariant');
|
||||||
var merge = require('merge');
|
var merge = require('merge');
|
||||||
|
@ -54,7 +55,7 @@ function createStrictShapeTypeChecker(
|
||||||
`\nValid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
`\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) {
|
if (error) {
|
||||||
invariant(
|
invariant(
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const UIManager = require('UIManager');
|
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.
|
* 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}`);
|
console.warn(`\`${propName}\` supplied to \`${componentName}\` has been deprecated. ${explanation}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return propType(props, propName, componentName);
|
return propType(
|
||||||
|
props,
|
||||||
|
propName,
|
||||||
|
componentName,
|
||||||
|
ReactPropTypeLocations.prop,
|
||||||
|
null,
|
||||||
|
ReactPropTypesSecret
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
"react-native": "local-cli/wrong-react-native.js"
|
"react-native": "local-cli/wrong-react-native.js"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "~15.2.1"
|
"react": "~15.3.0-rc.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"absolute-path": "^0.0.0",
|
"absolute-path": "^0.0.0",
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
"jest-repl": "^13.1.0",
|
"jest-repl": "^13.1.0",
|
||||||
"jest-runtime": "^13.1.0",
|
"jest-runtime": "^13.1.0",
|
||||||
"portfinder": "0.4.0",
|
"portfinder": "0.4.0",
|
||||||
"react": "~15.2.1",
|
"react": "~15.3.0-rc.2",
|
||||||
"shelljs": "0.6.0"
|
"shelljs": "0.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue