React-quill: Adding formula to the editor

Created on 5 Feb 2018  路  4Comments  路  Source: zenoamaro/react-quill

Hi.

After trying to add a formula to the editor, Quill throws an error in the console:

TypeError: Cannot read property 'render' of undefined

After digging a little bit, I found that the problem is the window.katex.render where katex is undefined.

Are you able to provide a solution?

Thanks.

React-Quill version

  • [*] master

Most helpful comment

I found the solution for react-quill. Add following code the it work.

  1. Install Katex

npm install katex

  1. Add following 3 line codes to your component
    /-----
    import katex from 'katex';
    import 'katex/dist/katex.min.css';
    window.katex = katex;
    class xxxxForm extends React.Component {
    .......................
    }
    ----/

Then the alarm cleared and formula input successfully

All 4 comments

I also encountered this problem, how to solve it...

You need to have katex available on the window - See the Quill docs: https://quilljs.com/docs/modules/formula/

Anyone solve this problem?

I found the solution for react-quill. Add following code the it work.

  1. Install Katex

npm install katex

  1. Add following 3 line codes to your component
    /-----
    import katex from 'katex';
    import 'katex/dist/katex.min.css';
    window.katex = katex;
    class xxxxForm extends React.Component {
    .......................
    }
    ----/

Then the alarm cleared and formula input successfully

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ycjcl868 picture ycjcl868  路  5Comments

andylacko picture andylacko  路  5Comments

prosenjitchy picture prosenjitchy  路  3Comments

levous picture levous  路  3Comments

matthewfbenjamin picture matthewfbenjamin  路  5Comments