We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d375ba7 commit 8298739Copy full SHA for 8298739
packages/doom/src/runtime/components/Masonry.tsx
@@ -1,4 +1,4 @@
1
-import MasonryLayout from 'masonry-layout'
+import type MasonryLayout from 'masonry-layout'
2
import { useLayoutEffect, useRef, type HTMLAttributes } from 'react'
3
4
export interface MasonryProps extends HTMLAttributes<HTMLDivElement> {
@@ -13,7 +13,11 @@ export const Masonry = ({ options, ...props }: MasonryProps) => {
13
return
14
}
15
16
- const masonry = new MasonryLayout(ref.current, options)
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
17
+ const masonry = new (require('masonry-layout') as typeof MasonryLayout)(
18
+ ref.current,
19
+ options,
20
+ )
21
22
return () => {
23
masonry.destroy?.()
0 commit comments