title: Navigation.getParam is undefined while trying to pass function as parameter
body: <p>I'm trying to use a function from my Main component in my details component which I user react navigation to navigate to and I want to save some changes in detail screen in my main component </p>
  
  <p>//Main.js</p>
  
  <pre><code>import React from 'react';
  import {
      StyleSheet ,
       Text,
       View, 
       TextInput,
       ScrollView,
       TouchableOpacity,
       KeyboardAvoidingView,
       AsyncStorage
      } from 'react-native'
  import Note from './Note'
  import { createStackNavigator, createAppContainer } from "react-navigation";
  import Details from './Details';
  
  
  export default class Main extends React.Component {
  
    static navigationOptions = {
      title: 'To do list',
      headerStyle: {
        backgroundColor: '#f4511e',
      },
    };
  
    constructor(props){
      super(props);
      this.state = {
        noteArray: [],
        noteText: ''
      };
    }
  render() {
  
      let notes = this.state.noteArray.map((val,key) =&gt; {
        return &lt;Note key={key} keyval={key} val={val}
        goToDetailPage= {() =&gt; this.goToNoteDetail(key)}
         /&gt;
      });
      const { navigation } = this.props;
      return(
          &lt;View style={styles.container}&gt;
           &lt;ScrollView style={styles.scrollContainer}&gt;
                  {notes}
              &lt;/ScrollView&gt;
             &lt;Details saveEdit={this.saveEdit} /&gt;
          &lt;/View&gt;
  
        );
      }
      goToNoteDetail=(key)=&gt;{   
        this.props.navigation.navigate('DetailsScreen', {
          selectedTask: this.state.noteArray[key],
          saveEdit: this.saveEdit
        });
      }
       saveEdit = (editedTask,dueDate) =&gt; {
       this.state.noteArray.push({ 
      'creationDate': editedTask['creationDate'], 
      'taskName': editedTask['taskName'],
      'dueDate': dueDate
    });
    this.setState({noteArray:this.state.noteArray})
    this.saveUserTasks(this.state.noteArray) 
  }    
        this.setState({noteArray:this.state.noteArray})
        this.saveUserTasks(this.state.noteArray) 
      }     
  }
  </code></pre>
  
  <p>Then I try to use it as prop in my Detail.js</p>
  
  <pre><code>import React from 'react';
  import {
      StyleSheet ,
       Text,
       View, 
       TextInput,
       Button,
       TouchableOpacity,
  
      } from 'react-native'
  import { createStackNavigator, createAppContainer } from "react-navigation";
  
  export default class Details extends React.Component {
  
     constructor(props){
      super(props);
     this.state = {
      dueDate = ''
     }
    }
  
    static navigationOptions = {
      headerStyle: {
        backgroundColor: '#f4511e',
      },  
    };
  
    componentDidMount = () =&gt; {
    this.getUserTasks()  
    } 
    render() {
  
      const { navigation } = this.props;
      const selectedTask = navigation.getParam('selectedTask', 'task');
      var { saveEdit} = this.props;
  
      return(
       &lt;View key={this.props.keyval} style={styles.container}&gt;
        &lt;View style = { styles.info}&gt;
                &lt;Text style= {styles.labelStyle}&gt; Due date:
                &lt;/Text&gt;
                &lt;TextInput
                          onChangeText={(dueData) =&gt; this.setState({dueData})}
                          style={styles.textInput}
                          placeholder= {selectedTask['dueDate']}  
                          placeholderTextColor='gray'
                          underlineColorAndroid = 'transparent'
                          &gt;
                &lt;/TextInput&gt;
        &lt;/View&gt;
        &lt;TouchableOpacity onPress={this.props.saveEdit(selectedTask, this.state.dueDate)} style={styles.saveButton}&gt;
                  &lt;Text style={styles.saveButtonText}&gt; save &lt;/Text&gt;
        &lt;/TouchableOpacity&gt;
      &lt;/View&gt;
      );
    }
  } 
  </code></pre>
  
  <p>I searched a lot to find the solution and I tried many of them but get different undefined errors. This is not what I did in the first place but when I search I found this solution <a href="https://stackoverflow.com/questions/49547751/react-native-pass-function-to-child-component-as-prop">here</a>. And I know it causes lots of issues. 
   I want to know how can I manage to access to main method from details and pass parameters to it or how can I manage to use main props in my details component</p>