title: How to call a function from a function?
body: <p>I really don't understand 100% well the scope of the variables in react native.</p>
  
  <p>I am calling a function from another component, and within this function there is a call to the component's function, but it seems to be out of the scope of this function:</p>
  
  <pre><code>addKeytoUser = (key, userID) =&gt; {
      try {
          this.collection(`${usrPostsDB}`).doc(`${key}`)
              .update(`${likesCol}`, firebase.firestore.FieldValue.increment(1))
          .then((result) =&gt; {
              this.collection(`${usrLikesCol}`).doc(`${userID}`).add(`${key}`);
               return result;
          }); 
      } catch ({ message }) {
          console.log(message);
      }       
  }
  </code></pre>
  
  <p>collection is function of the actual component, the first time that it is called return the right value but when called for second time after a sequential execution inside the (result)=> react returns that this.collection does not exist. 
  How can I call the component function from .then()=> </p>
  
  <p>Thank you</p>