# Saving state with gatsby/netlify

**URL:** <https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949>\
**Category:** General\
**Created:** [April 4, 2020, 8:44am UTC](https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949 "2020-04-04T08:44:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phil-Code](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/phil-code/32/140801_2.png) [@Phil-Code](https://forum.freecodecamp.org/u/Phil-Code)\
**Post date:** [April 4, 2020, 8:44am UTC](https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949/1 "2020-04-04T08:44:43Z")

</div>

Hi everyone!

I have deployed a simple site to Netlify built with Gatsby that lets me view, add and delete events to a calendar, journal and todo list etc.

Can anyone tell me some way of saving the changes I make when I use my web app so that they are stored by the app. At the moment the React component state reverts to my default values each time I refresh the page.

Is it possible to write to files in my GitHub repository somehow so I can save the component’s state? When I was playing around with Nodejs it was a case of using the fs module to read and write to files, but I was only using that on a local server and I can’t find a way of doing this kind of thing with Gatsby.

I have started looking into Netlify CMS but I’m not sure that’s really what I want.

Many thanks for any help you can give.

Cheers,

Phil

---

<div class="post-metadata">

**Author:** ![DanCouper](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dancouper/32/158608_2.png) [@DanCouper](https://forum.freecodecamp.org/u/DanCouper)\
**Post date:** [April 4, 2020, 9:18am UTC](https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949/2 "2020-04-04T09:18:22Z")

</div>

There normally needs to be a computer somewhere on a network where you can save things to the storage of (eg a machine acting as server that has a database installed on it). You connect to that to save things to/read things from the database. You can save things in the browser’s own temporary storage using [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), but that is still transient (it only applies to your browser, and if you clear storage or use incognito mode or whatever, it won’t be there). [Firebase](https://firebase.google.com/) I guess is the easiest at the minute, has simple integrations with Gatsby etc.

---

<div class="post-metadata">

**Author:** ![Phil-Code](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/phil-code/32/140801_2.png) [@Phil-Code](https://forum.freecodecamp.org/u/Phil-Code)\
**Post date:** [April 5, 2020, 7:51am UTC](https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949/3 "2020-04-05T07:51:31Z")

</div>

Thank you for the reply, Dan. I’ll have a look at Firebase and similar. Cheers.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 7:00pm UTC](https://forum.freecodecamp.org/t/saving-state-with-gatsby-netlify/367949/4 "2021-06-01T19:00:12Z")

</div>

Closed on June 1, 2021, 7:00pm UTC


