Skip to content

Instantly share code, notes, and snippets.

@elishaterada
Last active August 25, 2018 06:38
Show Gist options
  • Select an option

  • Save elishaterada/7103823667538a8a35fa6a797aee4443 to your computer and use it in GitHub Desktop.

Select an option

Save elishaterada/7103823667538a8a35fa6a797aee4443 to your computer and use it in GitHub Desktop.
React class component boilerplate
import React from 'react';
import PropTypes from 'prop-types';
import { cx, css } from 'react-emotion';
class ClassComponent extends React.Component {
render() {
const {
className,
} = this.props;
const wrapperStyle = cx(
css``,
className,
);
return (
<div
className={wrapperStyle}
>
<p>Hello ClassComponent</p>
</div>
);
}
}
ClassComponent.propTypes = {
className: PropTypes.string,
};
ClassComponent.defaultProps = {
className: null,
};
export default ClassComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment