Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secure-ls ( v.^1.2.6") can't find variable localStorage #47

Open
mohamedbelhassen opened this issue Sep 17, 2020 · 1 comment
Open

secure-ls ( v.^1.2.6") can't find variable localStorage #47

mohamedbelhassen opened this issue Sep 17, 2020 · 1 comment

Comments

@mohamedbelhassen
Copy link

I am trying to use secure-ls to encrypt local data of my Parse Server Application in a react-native project.
when typing the following two lines, I get the error "secure-ls can't find variable localStorage":

import SecureLS from 'secure-ls';
const ls = new SecureLS({ isCompression: false });

Could you tell me how to fix this error?

@zheNeng
Copy link

zheNeng commented Oct 13, 2020

this.ls = localStorage;

试试自己改一下这里?我想使用 sesstionStorage ,而不是 localStorage.

只要覆盖以下 api
clear setItem getItem remove 应该就可以直接用了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants