'Vue 3 - Composition API - TransitionGroup with slot

I have a transition group that render a list of element, i would like to add a component at the end as last list item. The last item is added via slot. Everything works fine but i get a warning that says "TransitionGroup children must be keyed." I triend to put key attribute on the slot or directly on the component that use it but the warning still remain, any idea?

here my component:

    <template>
        <TransitionGroup name="list">
            <CategoryListItem v-for="item in items" :key="item.id" />
            <slot :key="items.length + 1"></slot>
        </TransitionGroup>
    </template>

how can i programmately assign a key to the component that will be added to the list via slot?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source