Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Text.isText is not a function

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 }
    )
  },
like image 238
gurpartap Avatar asked Jul 04 '20 16:07

gurpartap


1 Answers

Try importing Text

import { Text } from 'slate';

like image 108
Rod Talingting Avatar answered Nov 07 '22 02:11

Rod Talingting