New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(PageItem): use "as" property as an anchor element #6754
Conversation
Could you change |
@kyletsang there seem to be a conflict with
|
Try removing the |
That's exactly what i did. If you look at the error message from TypeScript, you will see that there is a conflict with the base interface. <PageItem
as={({ children, ...props }) => (
<a {...props} data-anchor="custom">
{children}
</a>
)}
/> |
Try the following:
|
Thanks, it works. I was not able to change commit message, should i create a new PR, or you will manage it with squash? |
Yeah that's fine, I'll squash it. Thanks! |
I also kindly ask you to release a new version to NPM, it's already my second PR that i'm waiting to use in my project:) |
I just published v2.10.0. Thanks for the contributions! |
This Pull Request addresses the issue of limited routing flexibility in the
PageItem
component (#6753). By introducing theanchorAs
prop, it allows the specification of a custom component for rendering links, thereby enabling seamless integration with custom routing libraries like Next.js's<Link>
.Changes Made:
anchorAs
toPageItemProps
.PageItem
component to useanchorAs
as the component type for rendering the link.anchorAs
to the existingAnchor
component from@restart/ui/Anchor
.Benefits:
PageItem
in applications with custom routing requirements.Link
component or any other custom component for link rendering.I believe this enhancement will significantly benefit developers working with custom routing solutions and look forward to feedback and suggestions.