Last active
October 15, 2018 11:41
-
-
Save kamilkisiela/6bbc389bddae4107d40bc046a51da693 to your computer and use it in GitHub Desktop.
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 { Mutation } from '@loona/react'; | |
export default props => ( | |
<Mutation mutation={ADD_BOOK}> | |
{addBook => ( | |
<button onClick={() => addBook({ | |
variables: { | |
title: props.title | |
}, | |
// update() { | |
// we keep it all inside of the state class | |
// otherwise it would be hard to persist those store updates | |
// } | |
})}> Submit </button> | |
)} | |
</Mutation> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment