Skip to content

Commit

Permalink
fix: fixed imports
Browse files Browse the repository at this point in the history
  • Loading branch information
BowlingX committed Dec 18, 2023
1 parent 1e50cc8 commit da06ac1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/next-dynamic-loadable-shim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ import {
type DefaultComponent,
DefaultImportedComponent,
} from '@loadable/component'

const loadable = require('@loadable/component')
import { type DynamicOptions } from 'next/dynamic.js'
import * as React from 'react'

type DynamicImport = Parameters<typeof loadable>
const thisLoadable = loadable.default || loadable

type DynamicImport = Parameters<typeof thisLoadable>

const Fallback = () => <span>...</span>

Expand Down Expand Up @@ -54,7 +57,7 @@ export default function (
}
}
}
return loadable(dynamicImport, {
return thisLoadable(dynamicImport, {
ssr: options?.ssr,
fallback: options?.loader as unknown as JSX.Element,
resolveComponent: (
Expand Down

0 comments on commit da06ac1

Please sign in to comment.