Created
April 16, 2026 20:19
-
-
Save antlis/80202bfbd1318fb8faf285896123f618 to your computer and use it in GitHub Desktop.
Lightweight helper for lazy-loading components to improve performance metrics like LCP and INP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function defineLazyComponent(loader: () => Promise<any>) { | |
| return defineAsyncComponent({ | |
| loader, | |
| suspensible: false, | |
| }) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use case: