Open trinhminhhieu opened 6 months ago
Hello,I using Nextjs Uncaught (in promise) TypeError: quill.getSelection is not a function Nextjs
here code:
const imageHandler = useCallback(() => { const input = document.createElement("input"); input.setAttribute("type", "file"); input.setAttribute("accept", "image/*"); input.click(); input.onchange = async () => { if (input !== null && input.files !== null) { const file = input.files[0]; const url = await uploadImageToServer(file); const quill = quillRef.current; if (quill) { const range = quill.getSelection(); range && quill.getEditor().insertEmbed(range.index, "image", url); } } }; }, [quillRef]);
what the fuck
Hello,I using Nextjs Uncaught (in promise) TypeError: quill.getSelection is not a function Nextjs
here code: