1.0.0 • Published 2 years ago

react-mq-editor v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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;