Skip to content

Instantly share code, notes, and snippets.

@hyperh
Created September 12, 2017 03:10
Show Gist options
  • Save hyperh/0c25c9bc4300502bea120a649df4126b to your computer and use it in GitHub Desktop.
Save hyperh/0c25c9bc4300502bea120a649df4126b to your computer and use it in GitHub Desktop.
export default class appiumTutorial extends Component {
state = {
counter: 0,
text: '',
}
onPress = () => this.setState({ counter: this.state.counter + 1 })
onChangeText = text => this.setState({ text })
render() {
return (
<View style={styles.container} accessibilityLabel="testview">
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Double tap R on your keyboard to reload,{'\n'}
Shake or press menu button for dev menu
</Text>
<Text accessibilityLabel="counter">{this.state.counter}</Text>
<Button onPress={this.onPress} title="Press me" accessibilityLabel="button" />
<Text accessibilityLabel="text">{this.state.text}</Text>
<TextInput
accessibilityLabel="textinput"
style={{ width: '100%' }}
onChangeText={this.onChangeText}
value={this.state.text}
/>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment