Last active
July 30, 2019 10:46
-
-
Save gHashTag/79b26581785a23f9376bb860fa324f6c to your computer and use it in GitHub Desktop.
Apollo Link State. Set local storage.
This file contains 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 { useApolloClient } from 'react-apollo-hooks' | |
const App = () => { | |
const client = useApolloClient() | |
const onPress = elem => () => client.writeData({ data: { elem } }) | |
return ( | |
<View> | |
<TouchableOpacity onPress={onPress('text')}> | |
<Text>Set</Text> | |
</TouchableOpacity> | |
</View> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment