Created
September 3, 2020 05:24
-
-
Save joonaojapalo/854bf491bbdd9c7b79b30164d2d1e1cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 from "react"; | |
import PropTypes from "prop-types"; | |
const Link = ({ text, url }) => ( | |
<a href={url}>{text}</a>; | |
); | |
Link.propTypes = { | |
text: PropTypes.string.isRequired, | |
url: PropTypes.instanceOf(URL).isRequired, | |
}; | |
React.render( | |
<Link text="click me" url={new URL("http://google.com")} />, | |
document.body | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment