Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import {compose, setPropTypes, defaultProps} from 'recompose'
const enhance = compose(
onClick: PropTypes.func,
type: PropTypes.oneOf(['submit', 'button']),
className: PropTypes.func,
children: PropTypes.func.isRequired,
isLoading: PropTypes.bool,
type: 'button',
const Button = ({ type, className, children, onClick, isLoading }) => {
return (
<button type={type} className={className} onClick={onClick}>
{isLoading && <Loading />}
{!isLoading && children}
export default enhance(Button)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment