title: How to call a function of a class from another file in React Native?
body: <p>This is my initial screen:</p>
  
  <p><strong>LoginScreen.js</strong></p>
  
  <pre><code>import { Toast } from 'native-base'
  
  class LoginScreen extends Component {
  
    showError(error) {
      Toast.show({
        text: error
      })
    }
  
  .....
  
  }
  
  export default connect(mapStateToProps)(LoginScreen)
  </code></pre>
  
  <p>I am trying to invoke the <code>showError</code> function below like this:</p>
  
  <p><strong>loginAction.js</strong></p>
  
  <pre><code>import LoginScreen from './LoginScreen'
  
  let a = LoginScreen.showError('Testing')
  </code></pre>
  
  <p>I am getting an error saying:</p>
  
  <pre><code>LoginScreen.showError() is not a function
  </code></pre>