Skip to content

Instantly share code, notes, and snippets.

@lupomontero
Created April 19, 2018 14:12
Show Gist options
  • Save lupomontero/765a9ddf45f87ffc7df375902600c957 to your computer and use it in GitHub Desktop.
Save lupomontero/765a9ddf45f87ffc7df375902600c957 to your computer and use it in GitHub Desktop.
import React from 'react';
import PropTypes from 'prop-types';
const Profile = ({ user = {} }) => (
<div>
<h2>{user.name}</h2>
<p>
<a href={`mailto:${user.email}`}>
{user.email}
</a>
</p>
</div>
);
Profile.propTypes = {
user: PropTypes.shape({
name: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
}).isRequired,
};
export default Profile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment