From da06ac1914d6efbec0baf97712ecc750ceb41323 Mon Sep 17 00:00:00 2001 From: David Heidrich Date: Mon, 18 Dec 2023 19:55:11 +0100 Subject: [PATCH] fix: fixed imports --- src/next-dynamic-loadable-shim.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/next-dynamic-loadable-shim.tsx b/src/next-dynamic-loadable-shim.tsx index f018e7f..0409071 100644 --- a/src/next-dynamic-loadable-shim.tsx +++ b/src/next-dynamic-loadable-shim.tsx @@ -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 +const thisLoadable = loadable.default || loadable + +type DynamicImport = Parameters const Fallback = () => ... @@ -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: (