小编ton*_*ark的帖子

当我在 nextjs 项目中使用 jodti-react 文本编辑器时,自我未定义错误

当我在 nextjs 项目中使用 jodti-react 时,自我未定义错误

import React, { useState, useRef, useMemo } from "react";
import Dashborad from "./Dashborad";
import JoditEditor from "jodit-react";
import dynamic from "next/dynamic";

export default function edit() {
  const editor = useRef();
  const [content, setContent] = useState("");

  return (
    <Dashborad>
      <JoditEditor
        ref={editor}
        value={content}
        tabIndex={1} // tabIndex of textarea
        onBlur={(newContent) => setContent(newContent)} // preferred to use only this option to update the content for performance reasons
        onChange={(newContent) => setContent(newContent)}
      />
    </Dashborad>
  );
}

Run Code Online (Sandbox Code Playgroud)

}

如何解决这个错误?

javascript node.js angularjs reactjs next.js

5
推荐指数
1
解决办法
1159
查看次数

标签 统计

angularjs ×1

javascript ×1

next.js ×1

node.js ×1

reactjs ×1