Open diontron opened 2 years ago
as far as i know, you cannot pass actions to components in a natural way.
the author would have to accept an use
property in every component and forward it.
but what you can try to do is wrap the component inside a dom element (maybe a div, or a span), and apply the action to the wrapping element. i did this when i had to do things like handling click events on components that didnt forward an on:click
event.
another thing you can try is actually just using plain HTML with the required bootstrap css classes for the single element you want to use the action.
I am using Inertia and Sveltestrap.
I am trying to add
use:inertia
to a NavLink component but I get the following error:Here is the code:
Is there any way I can
use:inertia
on a non-DOM element (e.g. a component)?