title: React Native - no firebase app ' default ' has been created - call firebase.initializeapp()
body: <p>The problem is that when first time i build my app it's lunch and also gets the data from Firebase but when i do anything or refresh my app it then
  <a href="https://i.stack.imgur.com/badDh.jpg" rel="nofollow noreferrer">i receive this error always</a></p>
  <p><strong>no firebase app ' default ' has been created - call firebase.initializeapp()</strong></p>
  <p>there is my config i have done</p>
  <pre><code>export async function connectFirebase() {
    const config = {
      apiKey: &quot;XYZ&quot;,
      authDomain: &quot;XYZ.firebaseapp.com&quot;,
      projectId: &quot;XYZ&quot;,
      storageBucket: &quot;XYZ.appspot.com&quot;,
      messagingSenderId: &quot;29346298XYZ&quot;,
      appId: &quot;1:XYZw487:web:XYZdfku&quot;,
    };
    if (!firebase.apps.length) {
      firebase.initializeApp(config);
    }
  }
  </code></pre>