May 2, 2021 05:32 pm GMT
Original Link: https://dev.to/a7u/reactquill-with-nextjs-478b
ReactQuill with NextJS
Hey everyone, just wanted to share this with you. So I've been trying to find rich editors that were compatible with NextJS. Couldn't find any but I found a way to get ReactQuill working.
Import dynamic
import dynamic from 'react/dynamic'
After that import ReactQuill using dynamic
const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });
Now you can easily use it!
Example:
import { useState } from "react";import dynamic from 'next/dynamic';const ReactQuill = dynamic(() => import("react-quill"), { ssr: false });import 'react-quill/dist/quill.snow.css';function App() { const [value, setValue] = useState('') return( <ReactQuill value={value} onChange={setValue}/> )}export default App;
I hope this helps
Original Link: https://dev.to/a7u/reactquill-with-nextjs-478b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To