Created
January 17, 2017 11:27
-
-
Save ThisIsMissEm/615d9bbc9813945c9684dfea01f6f176 to your computer and use it in GitHub Desktop.
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 React from 'react'; | |
import { | |
registerComponent, | |
} from 'react-native-playground'; | |
import { | |
StatusBar, | |
Text, | |
View, | |
AsyncStorage, | |
} from 'react-native'; | |
class App extends React.Component { | |
constructor(props, context) { | |
super(props, context); | |
this.state = { | |
result: 'Click the button below to test' | |
}; | |
this.onPressTrigger = this.onPressTrigger.bind(this); | |
} | |
onPressTrigger() { | |
AsyncStorage.multiSet([]).then( | |
() => this.setState({ result: 'Success' }), | |
(err) => this.setState({ result: "Err: " + err.toString() }) | |
); | |
} | |
render() { | |
return ( | |
<View> | |
<Text> | |
{this.state.result} | |
</Text> | |
<Button | |
onPress={this.onPressTrigger} | |
title="Test Storage" | |
color="#841584" | |
/> | |
<StatusBar barStyle="default" /> | |
</View> | |
); | |
} | |
} | |
registerComponent(App); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment