'How do i use localstorage in React native?
I have a web app that I want to convert to an native app with react native.
So I started the project and all the logic is the same as the web-app but i don't know how to use the local storage of the app instead the browser.
Solution 1:[1]
you can't use localstorage in react native. Asyncstorage is provided in react-native. https://reactnative.dev/docs/asyncstorage
You can install package for that from this link. https://www.npmjs.com/package/@react-native-async-storage/async-storage
Hope this will help you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | cocoa |