mrousavy / react-native-mmkv

⚡️ The fastest key/value storage for React Native. ~30x faster than AsyncStorage!
https://mrousavy.com
MIT License
6.2k stars 259 forks source link

Property 'size' does not exist on type 'MMKV'.ts #717

Closed kaviisuru closed 3 months ago

kaviisuru commented 3 months ago

i use "react-native-mmkv": "^2.12.2" with expo, can't acces storage.size ,it's undefined

maintenance-hans[bot] commented 3 months ago

Guten Tag, Hans here! 🍻

It looks like you are having trouble accessing storage.size. Could you please check if you are using the correct instance of MMKV? Also, it would be sehr helpful to provide more context and any relevant logs to help us debug this issue better.

If you could also share your environment details like Expo version and any relevant setup, that would make it easier for mrousavy to assist you.

Danke!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

mrousavy commented 3 months ago

Why do you create a new issue? I just told you in the old one, size is only part of V3, not V2. https://github.com/mrousavy/react-native-mmkv/issues/716

kaviisuru commented 3 months ago

Oh, I'm really sorry, it was my mistake. By the way, I tried to install version 3, but it defaults to installing version 2. Can you give me any instructions, please?

kaviisuru commented 3 months ago

"Ah, okay. I managed it by using the " npx expo install react-native-mmkv@^3" command. Thank you for clarifying!"