react-mq-editor
v1.0.0
Published
MathQuill Editor for ReactJS
Downloads
1
Readme
React MathQuill
Install
npm i react-mq-editor --save
yarn add react-mq-editor
Usage
import { useState } from "react";
import { MathQuillEditor, MathQuillStatic } from "react-mq-editor";
import 'mathquill-node/lib/mathquill.css';
const Editor = () => {
const [latex, setLatex] = useState("x\\ =\\ \\frac{\\sqrt{4}}{6}");
return (
<div>
<MathQuillEditor
latex={latex}
config={{
handlers: {
edit: (mathField) => {
setLatex(mathField.latex());
},
},
}}
/>
<div>
<MathQuillStatic latex={latex} />
</div>
<p>{latex}</p>
</div>
);
};
export default Editor;