Skip to content

Support for passing custom component to as prop of Link component. #2443

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

pascalbaljet
Copy link
Member

Fixes #1746. Supports custom components instead of just HTML tags:

<Link as={CustomButton} method="post" href="/user" data={{ test: 'data' }}>
    Custom Component with Data
</Link>

Replaces PR #2264 and #1940 (will add you as a co-author). I've opened a new PR as this builds upon PR #2441 and I don't think Inertia should alter DOM elements. It now always passes the href attribute to custom components and it's up to the user to handle this (or not).

@pascalbaljet pascalbaljet marked this pull request as ready for review July 17, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link component as doesn't render other components
1 participant