inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Actions can only be applied to DOM elements, not components

Open diontron opened this issue 3 years ago • 0 comments

I am using Inertia and Sveltestrap.

I am trying to add use:inertia to a NavLink component but I get the following error:

Actions can only be applied to DOM elements, not components

Here is the code:

<script>
    import {inertia} from '@inertiajs/inertia-svelte'
    import {NavLink} from 'sveltestrap'
</script>

<NavLink href="/login" use:inertia>Login</NavLink>

Is there any way I can use:inertia on a non-DOM element (e.g. a component)?

diontron avatar Feb 21 '22 07:02 diontron