-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
bugSomething isn't workingSomething isn't working
Description
After upgrading to Svelte v5, I get an error:
TypeError: Class constructor SvelteMasonryGrid cannot be invoked without 'new'
I've tried wrapping the component in createClassComponent
(although deprecated) but I still get the same error.
My wrapper component
<script>
import { onDestroy, onMount } from 'svelte'
import { createClassComponent } from 'svelte/legacy'
import { MasonryGrid } from '@egjs/svelte-grid'
/**
* @typedef {Object} Props
* @property {number} [column]
* @property {string} [align]
* @property {number} [gap]
* @property {import('svelte').Snippet} [children]
*/
/** @type {Props} */
let { column = 2, align = 'stretch', gap = 16, children } = $props()
let container
let gridInstance
onMount(() => {
const GridComponent = createClassComponent({
component: MasonryGrid,
target: container,
props: {
column,
align,
gap,
},
})
gridInstance = GridComponent
})
onDestroy(() => {
if (gridInstance && gridInstance.destroy) {
gridInstance.destroy()
}
})
</script>
<div bind:this={container}>
{@render children?.()}
</div>
Any help is greatly appreciated!
xllifi, fiddler, GyrosOfWar and seisyll
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working