Last active
December 28, 2017 20:34
-
-
Save peterj/4c81735b1bd3ef8cd24f565e106c257d to your computer and use it in GitHub Desktop.
Link.js file for the tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
class Link extends Component { | |
render() { | |
return ( | |
<div> | |
<div> | |
{this.props.link.description} ({this.props.link.url} -{' '} | |
{this.props.link.hash}) | |
</div> | |
</div> | |
); | |
} | |
} | |
Link.propTypes = { | |
link: PropTypes.shape({ | |
id: PropTypes.string, | |
url: PropTypes.string, | |
hash: PropTypes.string, | |
description: PropTypes.string, | |
}), | |
}; | |
export default Link; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment