title: Is it normal that the same function returns two different results on two differents components?
body: <p>I'm working on an react-native app where i receive data from firestore. I put all the data received in on array and i use the lenght to make test before rendering. In the screen A the lenght is more than 0 but in the screen B it's 0 but both arrays contain data.</p>
  
  <p>it tried copy the code from one page to another but nothing, same result from both screens</p>
  
  <p>Screen A</p>
  
  <pre><code>getData = async () =&gt; {
      const ref = await firebase
        .firestore()
        .collection("PlatPost")
        .where("active", "==", true);
      this.unsubscribe = await ref.onSnapshot(this.parseData);
      await this.setState({ loading: false });
    };
  
    parseData = async querySnapshot =&gt; {
      await querySnapshot.forEach(async doc =&gt; {
        let _data = await doc.data();
        let key = await doc.id;
        let normalDate = await this.convertToDate(_data.date.toDate());
        await this.data.push({ ..._data, key, normalDate });
      });
      await this.setState({ data: [...this.data] });
      await console.log(this.data) //Printing the result in console
    };
  </code></pre>
  
  <p>Screen B</p>
  
  <pre><code>getData = async () =&gt; {
      const ref = await firebase
        .firestore()
        .collection("Notification")
        .where("recipient.id", "==", this.state.userId);
      this.unsubscribe = await ref.onSnapshot(this.parseData);
      await this.setState({ loading: false });
    };
  
    parseData = async querySnapshot =&gt; {
      await querySnapshot.forEach(async doc =&gt; {
        let _data = await doc.data();
        let key = await doc.id;
        let normalDate = await this.convertToDate(_data.date.toDate());
        await this.data.push({ ..._data, key, normalDate });
      });
      await this.setState({ data: [...this.data] });
      await console.log(this.data) //Priniting the result in console 
    };
  </code></pre>
  
  <p>Result from screen A</p>
  
  <pre><code>(3) [{…}, {…}, {…}]
  0: {username: "K", active: true, …}
  1: {username: "Cuisinier", active: true, …}
  2: {username: "K", active: true, …}
  length: 3
  __proto__: Array(0)
  </code></pre>
  
  <p>I expected the same result as the screen A but got this on screen B</p>
  
  <pre><code>[]
  0: {username: "hermann", active: true, …}
  1: {username: "Test", active: true, …}
  length: 0
  __proto__: Array(0)
  </code></pre>