Save some data from localstorage #2013
Unanswered
MR-Mostafa
asked this question in
Q&A
Replies: 1 comment
-
Think your issue could be with calling But you could also look into using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I had a question. I want to use SWR to save an API (Not All) in localstorage and then check next time if there is localstorage (and expire date id valid), so that the API will not be called and localstorage data will be restored.
How can I do this?
Unfortunately, I did not find a specific article on this
To achieve this, I created the following hook:
But when i use this hook, An error has occurred. (in nextjs)
Where is the problem with the code I wrote?
Thank you for your help
Beta Was this translation helpful? Give feedback.
All reactions