Never miss a beat

Join my newsletter.

Tag: autosave

Autosaving with React Hooks

Published: 12/21/2019

React hooks have really changed the game for me when it comes to building react components. However, I’ve found that writing autosaving functionality is a little less obvious via hooks. Thankfully, it is still possible (and arguably a lot cleaner) when using hooks. We can accomplish autosaving functionality through use of useEffect . You’ll also need a way to post the data to your server. In my case, I’m using Apollo’s useMutation hook as well. This allows me to post a graphql mutation from a…