I see one little problem with useState and }, [reviews]). This generates continuos requests to api by getReviews function. Try put console.log inside that function. I saw the same problem in other similar articles. IMO better is let useState has empty [ ], and call getReviews function from each components that make change to database. End effect is the same and there is no unnecessary api requests.