Skip to content

Instantly share code, notes, and snippets.

@dvtng
Last active June 12, 2017 11:52
Show Gist options
  • Save dvtng/e47a728d450d62639f117c36fb7067af to your computer and use it in GitHub Desktop.
Save dvtng/e47a728d450d62639f117c36fb7067af to your computer and use it in GitHub Desktop.
class CommentTemplate extends React.Component {
static propTypes = {
// Declare slots as type node
metadata: PropTypes.node,
actions: PropTypes.node,
};
render() {
return (
<div>
<CommentHeading>
<Avatar user={...}/>
// Slot for metadata
<span>{this.props.metadata}</span>
</CommentHeading>
<CommentBody/>
<CommentFooter>
<Timestamp time={...}/>
// Slot for actions
<span>{this.props.actions}</span>
</CommentFooter>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment