Skip to content

Commit

Permalink
Merge pull request #573 from doug-wade/fix-380
Browse files Browse the repository at this point in the history
Add support to Link for href
  • Loading branch information
doug-wade authored Aug 17, 2016
2 parents ea934e4 + f3f881a commit da833f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react-server/core/components/Link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = React.createClass({
displayName: 'Link',

propTypes: {
path : React.PropTypes.string.isRequired,
path : React.PropTypes.string,
href : React.PropTypes.string,
bundleData : React.PropTypes.bool,
frameback : React.PropTypes.bool,
reuseDom : React.PropTypes.bool,
Expand All @@ -24,7 +25,7 @@ module.exports = React.createClass({

render: function () {
return (
<a href={this.props.path} onClick={this._onClick} className={this.props.className}>{this.props.children}</a>
<a href={this.props.path || this.props.href} onClick={this._onClick} className={this.props.className}>{this.props.children}</a>
);
},

Expand All @@ -37,7 +38,7 @@ module.exports = React.createClass({
e.preventDefault();
e.stopPropagation();
const {bundleData, frameback, reuseDom, reuseFrame} = this.props;
navigateTo(this.props.path, {
navigateTo(this.props.path || this.props.href, {
bundleData,
frameback,
reuseDom,
Expand Down

0 comments on commit da833f5

Please sign in to comment.