Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove PropTypes dependency from ReactLink
It doesn't seem to be used. It was probably used by internal FB consumers of ReactLink which has long been removed.
  • Loading branch information
gaearon authored May 24, 2017
commit 9b2cd9681e2762c03005a5af7a1ee4db34b7c20c
23 changes: 0 additions & 23 deletions src/addons/link/ReactLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
*/

var PropTypes = require('prop-types');
var React = require('React');

/**
Expand All @@ -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;