-
Notifications
You must be signed in to change notification settings - Fork 935
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
ReactQuill component not appearing in NextJS 13.4.2 #897
Comments
did you find a solution ? |
Nope, hence switched to https://mantine.dev/others/tiptap/ instead. |
i have the same problem |
is that in the app directory or the old pages directory? |
I had the same issue. Then I tried importing ReactQuill without lazy loading it worked for me. Try this |
is it working in the app directory? |
Yes it's working in the app directory |
I have previously solved the following: const QuillNoSSRWrapper = dynamic( export const QuillToolbar = () => (
Arial
{/* Comic Sans
Courier New
Georgia
Helvetica
Lucida */}
Size 1
Size 2
Size 3
Size 4
Heading
Subheading
Normal
{/* */}
{/* */}
{/*
*/}
{/*
*/}
)
export function QuillPage({ value, setValue }: { value: any, setValue: any }) {
const dispatch = useDispatch()
const dispatchFormData = (data: any) =>
dispatch(UploadActions.uploadMultiRequest(data))
const multiUploading = useSelector(UploadReducers.multiUploading)
const multiUploadResponse = useSelector(UploadReducers.multiUploadResponse)
const editorRef = useRef(null)
const imageHandler = async () => {
const input = document.createElement("input")
input.setAttribute("type", "file")
input.setAttribute("accept", "image/*")
input.setAttribute("multiple", "multiple")
input.click()
input.onchange = async () => {
if (input.files) {
const listFile = input.files
dispatchFormData(listFile)
}
}
}
const [isOpen, setIsOpen] = useState(false)
useEffect(() => {
if(!multiUploadResponse) return
let quillObj = editorRef?.current?.getEditor();
const range = quillObj?.getSelection();
quillObj.editor.insertEmbed(range.index, 'image', multiUploadResponse?.links[0]);
}, [multiUploadResponse])
const ImgHandle =() => {
return (
pihgadgjgfjg,hdb,jfgjf
)
}
const modules = useMemo(
() => ({
toolbar: {
container: "#toolbar",
handlers: {
image: imageHandler,
// video: handleUploadImagePost
},
table: true,
},
history: {
delay: 500,
maxStack: 100,
userOnly: true,
},
}),
[]
)
{isOpen===true && ()}
const formats = [
"header",
"font",
"size",
"bold",
"italic",
"underline",
"align",
"strike",
"script",
"blockquote",
"background",
"list",
"bullet",
"indent",
"link",
"video",
"image",
"color",
"code-block",
// "table"
]
// useEffect(() => {
// if(!multiUploadResponse) return
// const quill = editorRef.current.getEditor()
// let indexPosition =
// }, [multiUploadResponse])
return (
<QuillNoSSRWrapper
forwardedRef={editorRef}
value={value}
onChange={(value: any) => setValue(value)}
placeholder={"Nội dung tối thiểu 100 kí tự"}
modules={modules}
formats={formats}
/>
)
}
Add component into your functional:
`
|
Fixed my problem
|
Thanks 👍 |
This helped me with passing ref (TS, NextJS)
|
This worked perfectly fine for me. Thank you. |
Thanks me a lot :) |
is not woking |
Same |
Check lib version in packege.json and try to reinstall it. |
Check out my comment with a native solution for next.js |
|
I'm not getting default value. How can I fix it? I'm using 14.0.1 |
I can't build reactQuill, It's ok in the dev server but when I try to build it with "yarn build" "it gives an error. import ReactQuill from 'react-quill'; const Settings = () => { return ( |
Try here solution1:
solution2:
|
It works like charm! on Next.js 14 + App router Thanks a lot! you saved me a week!!! |
Hello,
for those who tried hard and still not able to run the react-quill you can use react-quill-new. Your Welcome!!! |
Having an issue with ReactQuill component not appearing in NextJS project using React-Quill
v2.0.0
, NextJSv13.4.2
. After Loading, no component for Quill Editor renders on the screen, and it is surprising me.Any help would be appreciated.
Code
The text was updated successfully, but these errors were encountered: