Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xrutayisire committed Aug 30, 2024
1 parent 5b945b1 commit d73bfef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/react-server/PrismicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,19 @@ export const PrismicLink = React.forwardRef(function PrismicLink<
InternalComponentProps = React.ComponentProps<typeof defaultComponent>,
ExternalComponentProps = React.ComponentProps<typeof defaultComponent>,
>(
{
props: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,
ref: React.ForwardedRef<Element>,
): JSX.Element {
const {
field,
document: doc,
linkResolver,
internalComponent,
externalComponent,
children,
...restProps
}: PrismicLinkProps<InternalComponentProps, ExternalComponentProps>,
ref: React.ForwardedRef<Element>,
): JSX.Element {
} = props;

if (
typeof process !== "undefined" &&
process.env.NODE_ENV === "development"
Expand Down Expand Up @@ -182,7 +184,7 @@ export const PrismicLink = React.forwardRef(function PrismicLink<

return (
<Component ref={ref} {...attrs} {...restProps} href={href} rel={rel}>
{"children" in restProps ? children : text}
{"children" in props ? children : text}
</Component>
);
}) as <
Expand Down

0 comments on commit d73bfef

Please sign in to comment.