I am trying to load a component:
'use client';
import { dynamic } from 'next/dynamic';
import { useFormState } from 'react-dom';
import { postAction } from '@/lib/actions';
import BlogForm from '@/components/blogs/blog-form/blog-form';
const NewBlog = () => {
const [state, formAction] = useFormState(postAction, { message: null });
const BlogForm = dynamic(
import('@/components/blogs/blog-form/blog-form'),
{ ssr: false }
);
return (
<>
<BlogForm />
</>
)
}
export default NewBlog;
However, I get this error as output:
TypeError: (0 , next_dynamic__WEBPACK_IMPORTED_MODULE_1__.dynamic) is not a function
I am not sure what is causing the issue, I have followed the Nextjs docs and I have not come across is anyone else who had this problem?
I am using React 19 & Next 15.