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

MMKVStorage: 'Loader' is deprecated #521

Open
ansmlc opened this issue Apr 11, 2024 · 1 comment
Open

MMKVStorage: 'Loader' is deprecated #521

ansmlc opened this issue Apr 11, 2024 · 1 comment

Comments

@ansmlc
Copy link

ansmlc commented Apr 11, 2024

Following this example, from here:

/**
 * Wrapper for react-native-mmkv-storage.
 * See [https://rnmmkv.now.sh/#/gettingstarted](https://rnmmkv.now.sh/#/gettingstarted) for installation instructions.
 *
 * @example
 * const persistor = new CachePersistor({
 *   cache,
 *   storage: new MMKVStorageWrapper(new MMKVStorage.Loader().initialize()),
 * });
 *
 */

I get this error:

'Loader' is deprecated.ts(6385)
index.d.ts(10, 8): The declaration was marked as deprecated here.
Argument of type 'MMKVInstance' is not assignable to parameter of type 'MMKVStorageInterface'.
The types returned by 'getItem(...)' are incompatible between these types.
Type 'Promise' is not assignable to type 'Promise<string | null | undefined>'.
Type 'unknown' is not assignable to type 'string | null | undefined'.ts(2345)
(property) Loader: new () => MMKVLoader
@deprecated — Use import {MMKVLoader} from "react-native-mmkv-storage"

Can someone point me to how to use use apollo-cache-persist with MMKVStorage?

@clifinger
Copy link

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