Is there a way to dynamically import a library into my next.js project? or have it load in after the initial page load? I'm looking to dynamically import the toastify library below as it's not really needed until someone clicks on an element on the page.
Tried the following but no luck:
import dynamic from 'next/dynamic'
const { ToastContainer, toast } = dynamic(import('react-toastify'), { ssr: false });