小编Nee*_*esh的帖子

提示Tap useEditor 返回 null

我正在使用useEditorTipTap 库中的函数来创建编辑器,但它首先返回 null。我的意思是,如果我使用useEditor并立即记录我设置的变量,它会返回 null,但随后会返回一个 Editor 对象。我正在使用 React 和 create-react-app。

我的 App.js 文件中有这个:

const editorUse = useEditor({
    extensions: [StarterKit],
    content: JSON.parse(localStorage.getItem("text")) ?? "",
  });
  console.log(editorUse);
Run Code Online (Sandbox Code Playgroud)

它打印出这个: 错误图像

代码沙箱:https://codesandbox.io/s/zealous-darwin-iswww?file =/src/App.js

reactjs create-react-app tiptap

6
推荐指数
1
解决办法
2143
查看次数

标签 统计

create-react-app ×1

reactjs ×1

tiptap ×1