-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(types): Register built-in components Teleport and Suspense should work #4955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thanks but this wouldn't work for library custom components like RouterView or RouterLink in vue router. It would also be great to add a d-ts test to check for externally added components |
@@ -138,7 +138,7 @@ export interface ComponentOptionsBase< | |||
// Luckily `render()` doesn't need any arguments nor does it care about return | |||
// type. | |||
render?: Function | |||
components?: Record<string, Component> | |||
components?: Record<string, Component | { __isTeleport: true } | { __isSuspense: true } | { __isKeepAlive: true }> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same problem 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think components from user's land (including RouterView or RouterLink ) shall serve as Component
type, only built-in components Teleport, Suspense and KeepAlive need special treatment
d-ts test has been added, without changes in this pull request, it will fail |
7e9b02b
to
657af7d
Compare
✅ Deploy Preview for vue-sfc-playground ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for vuejs-coverage ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for vue-next-template-explorer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Could you please resolve the conflicts? |
fix #5833 & #4950 (built-in components like
Teleport
do not work)Cause is

which results in Teleport & Suspense are not legitimate
Component
type.However, as per office doc (usage with built-in components for rendering dynamic components),
<component :is="isGroup ? 'Teleport' : 'Suspense'"> ... </component>
will require to register built-in components