Skip to content

Commit

Permalink
Fix virtual field rendering of false & 0 (#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuckJonas committed Jul 16, 2021
1 parent ec73f47 commit 2ef6fe8
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

1 comment on commit 2ef6fe8

@vercel
Copy link

@vercel vercel bot commented on 2ef6fe8 Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.