-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document is not defined #292
Comments
Are you server-side rendering? #185 |
I am using nextjs, so yes |
OK, #185 should contain everything you need 😄 |
Hi, |
const ReactQuill = typeof window === 'object' ? require('react-quill') : () => false; // Use ReactQuill as desired |
In NextJS, you can use dynamic import to disable server-side rendering to fix this issue. Thanks |
Don't forget to import dynamic from 'next/dynamic' like I did for MuhammadMinhaj's answer to work! |
thanks! this works |
React Quill Rendering Twice ?? |
const ReactQuill = dynamic(import('react-quill'), { ssr: false}) |
I made a component for the quill editor and render it dynamic , and client side.
Then I import it on a form that is rendered also "use client" but I have this error:
|
Wrapping the import within useMemo solved the issue for me (source: https://stackoverflow.com/a/74096771/12103912) |
Tks. I work for me |
I Have the same problem if someone can help |
make sure include "use client" at the top of the file |
this helped me. don't forget to use 'useMemo' it will store the data otherwise it will render. and obviously, write the code inside of your react function component. |
greats work like a charm |
|
It worked perfectly Thank you |
The text was updated successfully, but these errors were encountered: