@tradelunch/usequill
v0.1.5
Published
react custom hook to use quill
Downloads
3
Maintainers
Readme
useQuill
use Quill on React with useQuill hook. I will update README.md
Example
import React, { useRef } from "react";
import { useQuill, QuillToolbarMemo } from "@tradelunch/usequill";
import "./assets/quill.bubble.css";
import "./assets/quill.snow.css";
type Props = {
class?: string;
};
const QuillEditor = (props: Props) => {
const toolBarRef = useRef<HTMLDivElement>(null);
const containerRef = useRef<HTMLDivElement>(null);
const boundsRef = useRef<HTMLDivElement>(null);
useQuill({
containerRef,
boundsRef,
toolBarRef,
});
return (
<div
style={{
margin: "20px",
}}
key={`${props.class}`}
>
<QuillToolbarMemo ref={toolBarRef} />
<div
style={{
display: "block",
}}
>
<div ref={boundsRef}>
<div className="editor" ref={containerRef} />
</div>
</div>
</div>
);
};
export default QuillEditor;