Skip to content

Instantly share code, notes, and snippets.

@MaximeHeckel
Last active February 1, 2018 18:32
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/292990ec336ff6a802dab7f872c0b698 to your computer and use it in GitHub Desktop.
Save MaximeHeckel/292990ec336ff6a802dab7f872c0b698 to your computer and use it in GitHub Desktop.
Medium - React “sub-components” - Article example 1
class MyArticleView extends React.Component {
...
render() {
return (
<div className={css.mainContainer}>
<div className={css.wrapper}>
<div className={css.titleContainer}>
<div className={css.title}>
<span>{this.renderTitle()}</span>
</div>
<div className={css.subtitle}>
<div className={css.subtitleBox}> {this.renderSubtitle()}</div>
</div>
</div>
<ul className={css.articlemetadata}>
<li className={css.item}>{this.renderAuthor()}</li>
<li className={css.item}>{this.renderDate()}</li>
</ul>
</div>
<div className={css.contentArticle}>
<div className={css.contentTextStyle}>{this.renderMainContent()}</div>
<span className={css.inlineComments}>{this.renderComments()}</span>
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment