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 <