react-quill: react-quill not working in Nextjs 15 and react 19
This is error message: TypeError: react_dom_1.default.findDOMNode is not a function
- I think this error cause by the version of my application but i dont know if it exactly the bug or not.
- Please, does someone have a way to fix this issue
- Version: “react”: “19.0.0-rc-f994737d14-20240522”, “react-dom”: “19.0.0-rc-f994737d14-20240522”, “next”: “15.0.0-rc.0”, “react-quill”: “^2.0.0-beta.4”,
I tryna use react-quill in my project but got error ** TypeError: react_dom_1.default.findDOMNode is not a function**
- This is my RichEditor component:
"use client"
// some import
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
export const RichEditorField = (props: IRichEditorFieldProps) => {
const quillRef = useRef<any>();
// more code goes herre
return (
<ReactQuill
// ref={quillRef}
placeholder={placeholder}
value={value}
modules={modules}
onChange={onChange}
className="wrap-quill"
readOnly={disabled}
formats={formats}
/>
);
};
- This is where i use my component:
// import
const QuillRichTextEditor = dynamic(
() =>
import(
"@/components/form-control/rich-editor-field/components/editor"
).then((mod) => mod.RichEditorField),
{
ssr: false,
loading: () => <p>Loading Text Editor...</p>,
}
);
// i try another way to import but it still won't work
import {RichEditorField} from '.....';
// some import here
export const ModalDetail = () => {
return (
<QuillRichTextEditor
label="Content"
formContext={formContext}
name={`content_${currentLocale.key}`}
disabled={isDisabeledField}
/>
)
};
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 29
This is because Chrome dropped support for a feature that an old quill version was using, and react-quill hasn’t been updated yet. Try replacing
react-quillwith the forked react-quill-new in the interim until react-quill is updated. Also follow https://github.com/zenoamaro/react-quill/pull/973 for updates on that.Thanks!!, this fork react-quill-new works for me!!
@LukasDeco If it happens with react-quill-new, it could very well be an issue with how react-quill-new interacts with react 19 or next-js. In this case, feel free to create an issue on the issues page for react-quill-new and share a minimal reproducible example, and I’ll fix it.
Thanks a million.
@Kimoalking It’s unlikely the “official” version will be updated since the maintainers are MIA and I can’t get in contact. If that doesn’t change, I imagine
react-quill-newwill be the “official” version going forward, which I’m also happy to give to a more active maintainer if there are any volunteersHeyo, I had a lot of issues implementing Quill.js in NEXT 15 + React 19 with plugins ! Essentially, I wanted to do this:
But I guess as @VaguelySerious pointed out, ‘react-quill’ doesn’t support react-19, ended up using react-quill-new and dynamically loading in the packages like this:
Then, for ‘Quill’, I used a useEffect hook to ensure it only renders on the client side:
This seems to have worked for me, hope it helps someone in the future!
Thanks so much. react-quill-new works for me.