Skip to content

Commit

Permalink
Fix virtual field rendering of false & 0 (keystonejs#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckJonas authored and Nikitoring committed Sep 14, 2021
1 parent 60ce2d2 commit d612ba0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-bobcats-float.md
@@ -0,0 +1,5 @@
---
'@keystone-next/fields': patch
---

Fixed virtual field rendering of false & 0 values.
2 changes: 1 addition & 1 deletion packages/fields/src/types/virtual/views/PrettyData.tsx
Expand Up @@ -10,7 +10,7 @@ const stringify = (data: any) => {
return JSON.stringify(dataWithoutTypename, null, 2);
};
export function PrettyData({ data }: { data: any }) {
if (!data) return null;
if (data === undefined || data === null) return null;

let prettyData: ReactNode = '';
if (typeof data === 'string') prettyData = data;
Expand Down

0 comments on commit d612ba0

Please sign in to comment.