admin管理员组文章数量:1221307
I'm following a slate tutorial on
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 }
)
},
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 }
)
},
Share
Improve this question
asked Jul 4, 2020 at 16:13
gurpartapgurpartap
4654 silver badges11 bronze badges
1 Answer
Reset to default 26Try importing Text
import { Text } from 'slate';
本文标签: javascriptTypeError TextisText is not a functionStack Overflow
版权声明:本文标题:javascript - TypeError: Text.isText is not a function - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739278083a2156107.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论