Hi this is my first time posting on reddit and I’m a beginner in coding ReactJS I honestly have no idea what I’m doing most of the time but I’m trying to learn by my own with videos and stackoverflow, please be nice.
Before we start I have done research and I have check videos on LocalData, Snapshot and all those I have also asked in stackoverflow 3 times and even added bounties but the first time I asked why it happened and I got the answer fair enough but didn’t got a fix for the issue just the reason of why it wasn’t working, 2nd time got marked as a duplicate because I linked the previous question but it was a complete different question, and lastly I just changed the format of the question and I’m now just waiting for an answer while I attempt multiple things and destroy my code, I’ll leave the link in description in case you want the bounty idk.
How to make data persist on refresh React JS? <- full code is here as well
I’m trying to render some data from firebase, I know how to do it and I never had issues before however in this code I’m working I have to go through multiple collections (more than 1 (just 2)), I’m using snapshot to render the data in real time and is working at a glance. However as soon as I hit refresh (F5) the data disappears even from the localStorage.
From a previous question I did on stackoverflow someone pointed out that the issue was because I was trying to render a collection inside a collection EJ:
db = firebase.firestore();
So far I have try adding array dependencies but it just make it as an endless loop, localStorage but still gets deleted on refresh I’m running out of ideas so I decided to come here and check.
This is a working demo that someone did for me but it only works for 1 collection and I did try it on my end but for some reason I get some errors that idk how to fix otherwise I would have done it (I tried and failed like a champion)
Thank you very much for reading all of it, let me know if you require something else. I didn’t post whole code cause is on the stackoverflow link if you want me to put it here I will I just don’t know how the formatting works here sorry.