ERROR Error: RNEncryptedStorage is undefined, js engine: hermes
at ContextNavigator (http://192.168.0.105:8081/node_modules%5Cexpo-router%5Centry.bundle//&platform=android&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=app:148715:24)
….
…
..
.
It gives an error when I try to execute this:
const token = await EncryptedStorage.getItem("user-token");
await EncryptedStorage.removeItem("user-token");
2
Answers
As you’re using Expo, I recommend using SecureStore https://docs.expo.dev/versions/latest/sdk/securestore/
Usage overview:
Set a value
Get a value
Expo supports also AsyncStorage https://docs.expo.dev/versions/latest/sdk/async-storage/
I recommend using it.
To store data use this
To retrieve data instead use this:
Use this as a base, as this two functions retrieve objects. If you only want to store a single string or value those are not ok.