Skip to content

Async Components

vue
<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';

const AsyncComp = defineAsyncComponent(() => import('./AsyncComp.vue'));
</script>
svelte
<script lang="ts">
  const AsyncComp = import('./AsyncComp.svelte');
</script>
tsx
import { lazy } from 'react';

const AsyncComp = lazy(() => import('./AsyncComp.tsx'));

Released under the MIT License.