Skip to content

quill-better-table with react-quill-new - property 'insertTable' does not exist on type 'unknown' #112

@probisgh

Description

@probisgh

The example from the package description (below) is not working for me.

import QuillBetterTable from 'quill-better-table'

Quill.register({
  'modules/better-table': QuillBetterTable
}, true)

window.onload = () => {
  const quill = new Quill('#editor-wrapper', {
    theme: 'snow',
    modules: {
      table: false,  // disable table module
      'better-table': {
        operationMenu: {
          items: {
            unmergeCells: {
              text: 'Another unmerge cells name'
            }
          }
        }
      },
      keyboard: {
        bindings: QuillBetterTable.keyboardBindings
      }
    }
  })

  document.body.querySelector('#insert-table')
    .onclick = () => {
      let tableModule = quill.getModule('better-table')
      tableModule.insertTable(3, 3)
    }
}

My imports are:

import React, { useState, useRef, useEffect, useCallback, useMemo } from 'react';
import ReactQuill, { Quill } from 'react-quill-new';
import 'react-quill/dist/quill.snow.css';
import 'quill-better-table/dist/quill-better-table.css';
import QuillResizeImage from 'quill-resize-image';
import QuillBetterTable from 'quill-better-table';

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions