From d73bfef28133647f9a63e9a2d30913e02ecfd31a Mon Sep 17 00:00:00 2001 From: Xavier Rutayisire Date: Fri, 30 Aug 2024 14:05:44 +0200 Subject: [PATCH] review fixes --- src/react-server/PrismicLink.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/react-server/PrismicLink.tsx b/src/react-server/PrismicLink.tsx index 203519a..86107bc 100644 --- a/src/react-server/PrismicLink.tsx +++ b/src/react-server/PrismicLink.tsx @@ -107,7 +107,10 @@ export const PrismicLink = React.forwardRef(function PrismicLink< InternalComponentProps = React.ComponentProps, ExternalComponentProps = React.ComponentProps, >( - { + props: PrismicLinkProps, + ref: React.ForwardedRef, +): JSX.Element { + const { field, document: doc, linkResolver, @@ -115,9 +118,8 @@ export const PrismicLink = React.forwardRef(function PrismicLink< externalComponent, children, ...restProps - }: PrismicLinkProps, - ref: React.ForwardedRef, -): JSX.Element { + } = props; + if ( typeof process !== "undefined" && process.env.NODE_ENV === "development" @@ -182,7 +184,7 @@ export const PrismicLink = React.forwardRef(function PrismicLink< return ( - {"children" in restProps ? children : text} + {"children" in props ? children : text} ); }) as <