Last active
July 14, 2017 09:05
-
-
Save bultas/7a5e0a3974423cef0018 to your computer and use it in GitHub Desktop.
React Stateless component example with props validation
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 Link from 'components/link'; | |
import { createStyles } from 'styles/styleSheet'; | |
export function Button({ onClick }) { | |
return ( | |
<Link style={styles.button} onClick={onClick} /> | |
); | |
} | |
Button.propTypes = { | |
onClick: React.PropTypes.func | |
}; | |
const styles = createStyles({ | |
button: { | |
backgroundColor: '#555' | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment