Right script setup dynamic components

Hi. I’m using computed to determinate dynamic component in script setup like this:
const ComputedComponent = computed(()=>foo?Comp1:Comp2)
<ComputedComponent …

Is there any difference from using <component :is=“foo?Comp1:Comp2” … ?

Hi @extremtmnt
you can use either of the ways, both work fine or if you want less code then you can go with “without computed” option.