From f3b01bfba0468a0eb7e3e29d82ad1badc9af654a Mon Sep 17 00:00:00 2001 From: Xavier Rutayisire Date: Sun, 8 Sep 2024 00:10:22 +0200 Subject: [PATCH] Fix warning when only text is filled --- src/react-server/PrismicLink.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/react-server/PrismicLink.tsx b/src/react-server/PrismicLink.tsx index 86107bc..3ef6ddb 100644 --- a/src/react-server/PrismicLink.tsx +++ b/src/react-server/PrismicLink.tsx @@ -136,7 +136,9 @@ export const PrismicLink = React.forwardRef(function PrismicLink< )}`, ); } else if ( - Object.keys(field).length > 1 && + ("text" in field + ? Object.keys(field).length > 2 + : Object.keys(field).length > 1) && !("url" in field || "uid" in field || "id" in field) ) { console.warn(