11

I'm following a slate tutorial on https://docs.slatejs.org/walkthroughs/04-applying-custom-formatting

There is a function call Text.isText(n), I keep getting Type:Error Text.isText is not a function

toggleBoldMark(editor) {
    const isActive = CustomEditor.isBoldMarkActive(editor)
    Transforms.setNodes(
      editor,
      { bold: isActive ? null : true },
      { match: n => Text.isText(n), split: true }
    )
  },
gurpartap
  • 375
  • 2
  • 9

1 Answers1

25

Try importing Text

import { Text } from 'slate';

Rod Talingting
  • 943
  • 1
  • 15
  • 25