-
Notifications
You must be signed in to change notification settings - Fork 28
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
@dev-plugins/react-native-mmkv - not showing the boolean data from the mmkv store #44
Comments
I'm facing the same problem. Using:
|
I believe it has to do with the dev-plugin using
I don't think Reading their Contributing though, not sure if this will get attention anytime soon |
I've created a patch using patch-package as a workaround. It seems to properly display string, numbers and booleans. However displaying patches/@dev-plugins+react-native-mmkv+0.0.1.patchdiff --git a/node_modules/@dev-plugins/react-native-mmkv/build/useMMKVDevTools.js b/node_modules/@dev-plugins/react-native-mmkv/build/useMMKVDevTools.js
index bb8b9e0..a556072 100644
--- a/node_modules/@dev-plugins/react-native-mmkv/build/useMMKVDevTools.js
+++ b/node_modules/@dev-plugins/react-native-mmkv/build/useMMKVDevTools.js
@@ -41,7 +41,18 @@ export function useMMKVDevTools({ errorHandler, storage = new MMKV() } = {}) {
try {
subscriptions.push(on('getAll', async () => {
const keys = storage.getAllKeys();
- return keys?.map(key => [key, storage.getString(key)]);
+ /**
+ * PATCH
+ *
+ * Workaround to display number and boolean values.
+ * May break edit interface, doesn't display Uint8Array values.
+ * See https://github.com/expo/dev-plugins/issues/44
+ */
+ return keys?.map(key => [key,
+ storage.getString(key) ||
+ storage.getNumber(key)?.toString() ||
+ storage.getBoolean(key)?.toString()
+ ]);
}));
}
catch (e) { |
Thanks for sharing @g-otn. Works as expected! |
Boolean data is not showing the Browser for mmkv dev plugin. Can anyone else confirm if they're facing this too?
The text was updated successfully, but these errors were encountered: