Team-Celsius / Halfsies

A mobile app that uses Google Cloud Vision AI OCR to itemize receipts for easy splitting. | React Native + Expo + Google Cloud Vision + Firebase
https://halfsies.onrender.com/
0 stars 1 forks source link

Participants: Can not update component while rendering different component #38

Open Jasonp1992 opened 1 year ago

Jasonp1992 commented 1 year ago

Error: Warning: Cannot update a component (Participants) while rendering a different component (ForwardRef(Pressable)). To locate the bad setState() call inside ForwardRef(Pressable), follow the stack trace as described in https://reactjs.org/link/setstate-in-render

In: Participants

line: 337

(setParticipants([...participants, favorites])

michaeltimo commented 1 year ago

been trying to crack this one for the past hour and a half with no luck, but it looks like the way to go is changing the state outside of the return

justintricate commented 1 year ago

I believe this is in AlphabeticalFriendsSection in the Pressable

I have a sneaking suspicion that it is the part before the return that's keeping track of setParticipants state within the return