use-st8
use-st8 copied to clipboard
Does it solve a problem of crazy re-rendering on any state change
Hi @mweststrate and thanks for the invention, looks cute :)). My case is, trying to implement following logic: On webpage load first see if my localStorage contains the needed information, and if so - fine, use it. Else - apiFetch it, use and also save it in localStorage for subsequent use. The information amount's not very small but rarely changes (why i want localStorage) I need some kinda intermediate storage (on frontend) which possibly less memory consuming and does not cause page re-render on any state change in the background like useState does (or did, based on my stale react knowledge :)). (By the way, i'm using react fullstack framework with graphql & prisma). The idea is to store some amount of information from (localStorage | apiCall) at any given moment, and the UI will depend on that store. Would it be a suitable solution ? Thanx a lot ))