I am trying to import a library dynamically in one of my next.js project. When i try to import that in don't get the default export from the library as expected. Firstly, i tried the next.js way as:
import dynamic from "next/dynamic";
const ConnectionReroutePlugin = dynamic(() => import('rete-connection-reroute-plugin'), { ssr: false });
Then i tried the react way as:
const ConnectionReroutePlugin = React.lazy(() => import('rete-connection-reroute-plugin'));
I am seeing the following import error:
Unhandled Rejection (TypeError): plugin.install is not a function
Anyone can address, what i am doing wrong and how can i import that?