Last active
August 25, 2018 06:38
-
-
Save elishaterada/7103823667538a8a35fa6a797aee4443 to your computer and use it in GitHub Desktop.
React class component boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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