title: React Native - Create method in functional component and call this method outside of the component, possible?
body: <p>I have a custom modal component:</p>
  
  <pre><code>export default ModalLoader = props=&gt;{
    const {
      loading,
      ...attributes
    } = props;
  
    function closeModal(){
      console.log('Close Modal Kepanggil coyyy!!!!!!!')
    }
  
    return(
      &lt;Modal
        transparent={true}
        animationType={'none'}
        visible={loading}
      &gt;
        &lt;View&gt;
          &lt;View&gt;
            &lt;ActivityIndicator
              size={'large'}
              color={colors.darkRed}
            /&gt;
            &lt;CustomText style={{fontSize:24}}&gt;Mohon Tunggu...&lt;/CustomText&gt;
          &lt;/View&gt;
        &lt;/View&gt;
      &lt;/Modal&gt;
    )
  }
  </code></pre>
  
  <p>i want to used <code>closeModal()</code> in <code>axios instance</code>, so everytime <code>axios</code> get a response, i want to close modal in axios file itself not in all of my component,</p>
  
  <p>let say my axios instance something like this:</p>
  
  <pre><code>AxiosHttp.interceptors.response.use((res)=&gt;{
    CustomLog(res.data, 'Interceptor')
    // call closeModal of ModalLoader
    ModalLoader.closeModal()
    return res.data;
  },(err)=&gt;{
    CustomLog(err, 'Interceptor Error')
    // call closeModal of ModalLoader
    ModalLoader.closeModal()
    return Promise.reject(err)
  })
  
  export default AxiosHttp
  </code></pre>
  
  <p>is it possible to do that?</p>