-
Notifications
You must be signed in to change notification settings - Fork 39
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
Is it possible to lazy load components and use them in TSX? #24
Comments
Currently, async components are not supported. As a workaround, you can let async components pretend normal component like below. export function pretendNormalComponent<A extends Promise<typeof Vue>>(
factory: () => A
): A extends Promise<infer V> ? V : never {
return factory as any;
}
const LazyComp = pretendNormalComponent(() => import("@/LazyComp")); |
Leave this issue opened until async component will be supported formally. |
I tried this but got an issue.
|
The component look like:
|
Marked in Bold is what helped me to achieve the same. import("./lib/select-list").then((m) => m.default) More details follows:
My Component look like
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
and somewhere below in render function:
Runtime is ok, but Typescript is not:
The text was updated successfully, but these errors were encountered: