You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{h,Component}from'vue'constserializers={Paragraph: 'p',Component: {}asComponent<any>}constsampleComponent=serializers[''askeyoftypeofserializers]// This is a type errorh(sampleComponent)h(sampleComponent,'')// This isn'tif(typeofsampleComponent==='string'){h(sampleComponent)h(sampleComponent,'')}else{h(sampleComponent)h(sampleComponent,'')}
Steps to reproduce
If we have a component to render that is string | Component we have to narrow its type even if we are calling h() in a way that doesn't make a difference.
What is expected?
I expect not to have to narrow the type in this instance.
What is actually happening?
I am having to add a needless check.
The text was updated successfully, but these errors were encountered:
Version
3.2.31
Reproduction link
www.typescriptlang.org/play
Steps to reproduce
If we have a component to render that is
string | Component
we have to narrow its type even if we are calling h() in a way that doesn't make a difference.What is expected?
I expect not to have to narrow the type in this instance.
What is actually happening?
I am having to add a needless check.
The text was updated successfully, but these errors were encountered: