Skip to content

Instantly share code, notes, and snippets.

@pokorson
Created February 6, 2018 19:22
Show Gist options
  • Save pokorson/2a5f40a16aa78034730704ba8853ab7e to your computer and use it in GitHub Desktop.
Save pokorson/2a5f40a16aa78034730704ba8853ab7e to your computer and use it in GitHub Desktop.
Recompose examples
const Buttons = branch(
props => props.loading,
withProps({ label: 'LOADING...', isDisabled: true }),
withProps({ id: 'signIn', label: 'SIGN IN', type: 'submit' })
)(SignInButton);
const Buttons = ({ loading }) =>
loading ? (
<SignInButton label="LOADING..." isDisabled={true} />
) : (
<SignInButton id="signIn" label="SIGN IN" type="submit" />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment