【问题标题】:can anybody tell me how to integrate etherpad-lite-client with reactjs谁能告诉我如何将 etherpad-lite-client 与 reactjs 集成
【发布时间】:2022-07-05 05:59:05
【问题描述】:

我正在创建一个 react 项目,我需要一个 etherpad 实时文本编辑器,但我不知道该怎么做,任何人都可以提出任何建议。

我了解了“etherpad-lite-client”包,但仍然不知道它的应用程序,如何将它与 react 一起使用。 这是网址https://www.npmjs.com/package/etherpad-lite-client 任何帮助表示赞赏

【问题讨论】:

    标签: reactjs etherpad


    【解决方案1】:

    这是我在一个项目中使用的代码。

    const [etherpad, setEtherpad] = useState(null); 使用效果(()=> { 设置以太网垫( api.connect({ 密钥: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 主机:process.env.REACT_APP_PAD_API_URL, 端口:process.env.REACT_APP_PAD_PORT, ssl:是的, }) ); }, []);

    访问 etherpad API:

    etherpad.listAllPads(函数(错误,数据){

    console.log(数据);

    })

    【讨论】: