diff --git a/src/Pagination.tsx b/src/Pagination.tsx index 43a3759b7..01b830812 100644 --- a/src/Pagination.tsx +++ b/src/Pagination.tsx @@ -1,4 +1,4 @@ -import React, { memo, forwardRef, type CSSProperties } from "react"; +import React, { memo, forwardRef, type CSSProperties, ReactNode } from "react"; import { symToStr } from "tsafe/symToStr"; import { assert } from "tsafe/assert"; import type { Equals } from "tsafe"; @@ -8,6 +8,18 @@ import { createComponentI18nApi } from "./i18n"; import { RegisteredLinkProps, getLink } from "./link"; import { useAnalyticsId } from "./tools/useAnalyticsId"; +const DynamicLink = ({ + useReactLinkComponent, + children, + ...rest +}: { + useReactLinkComponent: boolean; + children: ReactNode; +}) => { + const { Link } = getLink(); + return useReactLinkComponent ? {children} : {children}; +}; + export type PaginationProps = { id?: string; className?: string; @@ -100,36 +112,43 @@ export const Pagination = memo(