inertiajs / inertia

Inertia.js lets you quickly build modern single-page React, Vue and Svelte apps using classic server-side routing and controllers.
https://inertiajs.com
MIT License
6.5k stars 435 forks source link

How do I make a custom component act as an inertia link? #1668

Closed jdion84 closed 1 year ago

jdion84 commented 1 year ago

Using React Bootstrap and it allows you to specify hrefs in the components e.g.:

<Navbar.Brand href="/">
    {app.name}
</Navbar.Brand>

How would I make this Navbar.Brand component act like an inertia Link?

IsaacMercado commented 1 year ago

Uses the as attribute in the Navbar.Brand. It would look something like this:

<Navbar.Brand href="/" as={Link}>
    {app.name}
</Navbar.Brand>

This only works for some bootstrap components.

jessarcher commented 1 year ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question that may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use the functionality provided by this repository, you can try one of the following channels:

However, this issue will not be locked, and everyone is free to discuss solutions to your problem!