Last active
August 25, 2018 08:26
-
-
Save elishaterada/28be59662d922a9dc4f9657bde08d71c to your computer and use it in GitHub Desktop.
React Functional Component
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'; | |
| const FunctionalComponent = ({ | |
| className, | |
| }) => { | |
| const wrapperStyle = cx( | |
| css``, | |
| className, | |
| ); | |
| return ( | |
| <div | |
| className={wrapperStyle} | |
| > | |
| <p>Hello FunctionalComponent</p> | |
| </div> | |
| ); | |
| }; | |
| FunctionalComponent.propTypes = { | |
| className: PropTypes.string, | |
| }; | |
| FunctionalComponent.defaultProps = { | |
| className: null, | |
| }; | |
| export default FunctionalComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment