0

We have this code of react ga that we have put inside ComponentDidMount and the debugger shows that the code is being run just fine which is fine. However the issue that I see is that in my network tab is that there are three requests going and all has status code of 200. Now why is this happening when code is being run just once ?Shouldn't there be just one call in network tab. I don't see any preflight request instead all are get with status code 200 . Here is the ComponentDidMount part

componentDidMount = async () => {
    // some api calls here and setstate happening in these methods 
   this.getCredit()
    this.getDashboardData()
    this.getKYC()
    debugger
    initGA('UA-146381335-1');
    PageView();

  }```
horrible_nerd
  • 115
  • 3
  • 9

1 Answers1

0

I think the issue is because the component is getting remouted several time, instead of rerendering.

Aphrem Thomas
  • 263
  • 2
  • 8