Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PropTypes dependency from ReactLink #9766

Merged
merged 1 commit into from May 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 0 additions & 23 deletions src/addons/link/ReactLink.js
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;