Skip to content

MMKVStorage: 'Loader' is deprecated #521

Open
@ansmlc

Description

@ansmlc

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions