mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Remove PropTypes dependency from ReactLink (#9766)
It doesn't seem to be used. It was probably used by internal FB consumers of ReactLink which has long been removed.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
|
||||
*/
|
||||
|
||||
var PropTypes = require('prop-types');
|
||||
var React = require('React');
|
||||
|
||||
/**
|
||||
@@ -49,26 +48,4 @@ function ReactLink(value, requestChange) {
|
||||
this.requestChange = requestChange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a PropType that enforces the ReactLink API and optionally checks the
|
||||
* type of the value being passed inside the link. Example:
|
||||
*
|
||||
* MyComponent.propTypes = {
|
||||
* tabIndexLink: ReactLink.PropTypes.link(React.PropTypes.number)
|
||||
* }
|
||||
*/
|
||||
function createLinkTypeChecker(linkType) {
|
||||
var shapes = {
|
||||
value: linkType === undefined
|
||||
? PropTypes.any.isRequired
|
||||
: linkType.isRequired,
|
||||
requestChange: PropTypes.func.isRequired,
|
||||
};
|
||||
return PropTypes.shape(shapes);
|
||||
}
|
||||
|
||||
ReactLink.PropTypes = {
|
||||
link: createLinkTypeChecker,
|
||||
};
|
||||
|
||||
module.exports = ReactLink;
|
||||
|
||||
Reference in New Issue
Block a user