Created
December 28, 2016 07:08
-
-
Save nayunhwan/b286d22da3722ff6a94c36c927118973 to your computer and use it in GitHub Desktop.
React Extracting Component Example
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
function Comment(props) { | |
return ( | |
<div className="Comment"> | |
<div className="UserInfo"> | |
<img className="Avatar" | |
src={props.author.avatarUrl} | |
alt={props.author.name} | |
/> | |
<div className="UserInfo-name"> | |
{props.author.name} | |
</div> | |
</div> | |
<div className="Comment-text"> | |
{props.text} | |
</div> | |
<div className="Comment-date"> | |
{formatDate(props.date)} | |
</div> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment