Skip to content

Instantly share code, notes, and snippets.

@collinglass
Last active December 16, 2017 11:56
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 collinglass/5700872cd5614e012fd456217dbb7fc6 to your computer and use it in GitHub Desktop.
Save collinglass/5700872cd5614e012fd456217dbb7fc6 to your computer and use it in GitHub Desktop.
export default class MessageContainer extends React.Component {
// ...
renderFooter() {
if (this.props.renderFooter) {
const footerProps = {
...this.props,
};
return this.props.renderFooter(footerProps);
}
return null;
}
renderLoadEarlier() {
if (this.props.loadEarlier === true) {
const loadEarlierProps = {
...this.props,
};
if (this.props.renderLoadEarlier) {
return this.props.renderLoadEarlier(loadEarlierProps);
}
return (
<LoadEarlier {...loadEarlierProps}/>
);
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment