elgerlambert/redux-localstorage

adapter for localForage is now unavailable from redux-localstorage

kevademfidel opened this issue · 3 comments

after I add @types/redux-localstorage, I could not use an adapter for a LocalForage type object.

import adapter from 'redux-localstorage/lib/adapters/localForage'; is now throwing an error:

TS2307: Cannot find module 'redux-localstorage/lib/adapters/localForage'.

However, if I import it this way:
import adapter from 'redux-localstorage/lib/adapters/AsyncStorage';, the terminal says
Module not found: Can't resolve 'redux-localstorage/lib/adapters/AsyncStorage' though it exists

can anyone help me with this issue? thanks!

@kevademfidel have you find a solution for this issue

NOTE: Be sure to check out the 1.0-breaking-changes branch (available on npm as redux-localstorage@rc). It includes support for flexible storage backends, including (but not limited to) sessionStorage and react-natives' AsyncStorage.

Also getting this error: Error: Unable to resolve module redux-localstorage/lib/adapters/AsyncStorage from C:\Users\********\Desktop\********\src\store\store.js: redux-localstorage/lib/adapters/AsyncStorage could not be found within the project or in these directories: node_modules ..\..\node_modules

   6 | import authReducer from './slices/authenticated';
   7 | import AsyncStorage from '@react-native-async-storage/async-storage';
>  8 | import adapter from 'redux-localstorage/lib/adapters/AsyncStorage';
     |                      ^
   9 |
  10 | const storage = adapter(AsyncStorage);
  11 |