Why do I need to do dynamic import with some components in next
React quill editor in my app was causing too much of an issue when I was making the build.
Dynamic importing these components can help you getting rid of this issue.
Second, we have to disable ssr on these components. That is set ssr to false.
Ssr or Server-Side Rendering involves generating the HTML for a web page on the server before sending it to the client’s browser. In nextJs ssr is seamlessly integrated, means when a user requests a page it renders it on server and send the pre-rendered html to the client.
Well, I had to disable it for my build.
My code-block
const ReactQuill = dynamic(() => import('react-quill'), {
ssr: false ///set it false
})