react-responsive-pagination icon indicating copy to clipboard operation
react-responsive-pagination copied to clipboard

Cannot Change Href, Affecting SEO

Open 1991Pawel opened this issue 1 year ago • 1 comments

Currently, it is not possible to change the href, and this negatively impacts SEO.

href={linkHref === 'hash' ? '#' : undefined}

1991Pawel avatar Sep 12 '24 18:09 1991Pawel

Thank you for your request 😄

I'll implement this by allowing the linkHref prop to be a callback, here's an example:

<ResponsivePagination
  ...
  linkHref={page => `/content/${page}`}
/>

This should give full flexibility in case there is any logic based on the page number

jonelantha avatar Sep 15 '24 17:09 jonelantha

:tada: This issue has been resolved in version 2.8.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Sep 17 '24 17:09 github-actions[bot]

v2.8.0 supports a callback value for linkHref

Please see https://react-responsive-pagination.elantha.com/props/#misc-props for an example

Thank you for your request 😄

jonelantha avatar Sep 17 '24 18:09 jonelantha

Thank you for implementing this feature so quickly.

1991Pawel avatar Sep 17 '24 18:09 1991Pawel