Skip to content

Instantly share code, notes, and snippets.

@joonaojapalo
Created September 3, 2020 05:24
Show Gist options
  • Save joonaojapalo/854bf491bbdd9c7b79b30164d2d1e1cf to your computer and use it in GitHub Desktop.
Save joonaojapalo/854bf491bbdd9c7b79b30164d2d1e1cf to your computer and use it in GitHub Desktop.
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