1
 moudlues = {
    toolbar: {
      container: toolbarOptions,
      handlers: {
        link: () => this.openLinkDialog(quillRef),
      },
    },
  };

I'm having issue with passing a function with an argument to the modules handler in ReactQuill

I tried this way

getModules = (quillRef) => ({
    toolbar: {
      container: toolbarOptions,
      handlers: {
        link: () => this.openLinkDialog(quillRef),
      },
    },
  });
  renderEditor = (quillRef, onChangeHandler) => {
    const modules = this.getModules(quillRef);
    return (
  <ReactQuill
          ref={quillRef}
          modules={modules}
          onChange={onChangeHandler}
        />
      </div>
    );

I got this runtime error

Uncaught runtime errors:
×
ERROR
Cannot read properties of undefined (reading 'delta')
TypeError: Cannot read properties of undefined (reading 'delta')
    at ReactQuill.componentDidUpdate (http://localhost:3000/static/js/bundle.js:178758:20)
    at commitLayoutEffectOnFiber 

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.