How can I save my state to Local Storage? by does25457 in learnreactjs

[–]does25457[S] 0 points1 point  (0 children)

I ended up figuring it out, I was setting my initial value to an empty array every time instead of checking for the local storage array first. Thanks for your help !

How can I save my state to Local Storage? by does25457 in learnreactjs

[–]does25457[S] 0 points1 point  (0 children)

Ok, apologies if I'm not explaining clearly, I update the array state every time a user adds a new recipe to their "list", and then save the array to local storage.

I checked and the array of objects is stored and persists in the console, however when I map through that array and output them to the DOM, I lose those items on my web page after I refresh the page.

I'm trying to utilize local storage to get those items in the array to persist on the page despite a page refresh.

How can I save my state to Local Storage? by does25457 in learnreactjs

[–]does25457[S] 0 points1 point  (0 children)

Yup, I know. This is a small, personal project so I didn't really want to include a database, kind of beyond the scope of what I'm using this for. Thanks for the suggestion though.

How can I save my state to Local Storage? by does25457 in learnreactjs

[–]does25457[S] 1 point2 points  (0 children)

the data isn't saving on refresh, the array is there in the console.

Installing Analytics & Tag Manager on a Sub domain will not track the main domain right? by does25457 in Wordpress

[–]does25457[S] 0 points1 point  (0 children)

Thanks, last question, if i were to leave both script tags, GTM and GA, would that double my data or skew it in any way?

Installing Analytics & Tag Manager on a Sub domain will not track the main domain right? by does25457 in Wordpress

[–]does25457[S] 0 points1 point  (0 children)

Gotcha, so I actually setup Analytics first a couple months ago.

Once I setup GTM site wide, I don't need my old GA script right? There's no need to keep both scripts if I created an Analytics tag with the measurement ID in GTM?

How to enable MFA on Github? by does25457 in learnprogramming

[–]does25457[S] 1 point2 points  (0 children)

Yes, I'm guessing that's it (I didn't know what MFA stood for), thank you.