Skip to content

Instantly share code, notes, and snippets.

@MaximeHeckel
Last active February 1, 2018 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaximeHeckel/3c6e99694e7a19ad8ff2114f4d62ca6b to your computer and use it in GitHub Desktop.
Save MaximeHeckel/3c6e99694e7a19ad8ff2114f4d62ca6b to your computer and use it in GitHub Desktop.
Medium - React "sub-components' - Article example 2
class MyArticleView extends React.Component {
...
render() {
return (
<Article>
<Article.Title>{this.renderTitle()}</Article.Title>
<Article.Subtitle>{this.renderSubtitle()}</Article.Subtitle>
<Article.Metadata>
{this.renderAuthor()}
{this.renderDate()}
</Article.Metadata>
<Article.Content>{this.renderContent()}</Article.Content>
<Article.Comments>{this.renderComments}</Article.Comments>
</Article>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment