Guest User

Untitled

a guest
Jan 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. accessibilityLabel={title ? `${title}, back` : 'Go back'}
  2. accessibilityTraits="button"
  3. testID="header-back"
  4.  
  5. static navigationOptions = {
  6. headerTitle: 'Title',
  7. headerRight: (
  8. <Button
  9. onPress={() => alert('This is a button!')}
  10. title="Right"
  11. color="#000"
  12. testID='headerRightButton'
  13. accessibilityLabel="Right button!"
  14. />
  15. ),
  16. headerLeft: (
  17. <Button
  18. onPress={() => alert('This is a button!')}
  19. title="Left"
  20. color="#000"
  21. testID='headerLeftButton'
  22. accessibilityLabel="Left button!"
  23. />
  24. )
  25. };
  26.  
  27. class MyButton extends Component {
  28. render() {
  29. return (
  30. <TouchableOpacity onPress={() => {}}
  31. testID={this.props.testID}
  32. accessibilityLabel={this.props.accessibilityLabel}
  33. >
  34. <View>
  35. // style your awesome button here
  36. </View>
  37. </TouchableOpacity>
  38. );
  39. }
  40. }
  41.  
  42. <MyButton
  43. testID={'mybutton'}
  44. accessibilityLabel={'tap my button'} />
Add Comment
Please, Sign In to add comment