Guest User

Untitled

a guest
Jan 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import React from 'react'
  2. import {
  3. View,
  4. Button
  5. } from 'react-native'
  6.  
  7. class MyScreen extends React.Component {
  8. static navigationOptions = ({ navigation }) => {
  9. const { state } = navigation
  10. return {
  11. headerTitle: 'New Task',
  12. headerRight: <Button title="Save" onPress={() => state.params.handleSave()} />,
  13. }
  14. }
  15.  
  16. saveDetails() {
  17. alert('saved')
  18. }
  19.  
  20.  
  21. componentDidMount() {
  22. this.props.navigation.setParams({ handleSave: () => this.saveDetails() })
  23. }
  24.  
  25. render() {
  26. return (
  27. <View />
  28. )
  29. }
  30. }
Add Comment
Please, Sign In to add comment