Skip to content

Instantly share code, notes, and snippets.

@bultas
Last active July 14, 2017 09:05
Show Gist options
  • Save bultas/7a5e0a3974423cef0018 to your computer and use it in GitHub Desktop.
Save bultas/7a5e0a3974423cef0018 to your computer and use it in GitHub Desktop.
React Stateless component example with props validation
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