Skip to content

Commit

Permalink
return undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 18, 2024
1 parent b287c2d commit c4c1eff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export function useMMKVObject<T>(
setJson((currentJson) => {
const currentValue = currentJson != null ? JSON.parse(currentJson) : undefined
const newValue = v(currentValue);
return JSON.stringify(newValue);
return newValue != null ? JSON.stringify(newValue) : undefined;
});
} else {
// Store the Object as a serialized Value or clear the value
Expand Down

0 comments on commit c4c1eff

Please sign in to comment.