wangEditor-for-react
wangEditor-for-react copied to clipboard
wangEditor v5 React component
Toolbar 的实例是外部定义传进去的。Editor的实例看了下是组件内部定义的,那不就有两个实例了。应该Editor的实例也是外部定义传进去吧
使用wangEditor-for-react,再配置webpack5的cache之后,会导致内存溢出。将其依赖放到devDependencies中,就不会报错。这是为什么? 
src/components/Editor.tsx路径文件内有一段赋值逻辑,只有editor未创建时才会执行,导致onChange函数之后无法更新,使用的一直是初始创建时组件内的值,相当于闭包了。从而在使用时,页面只能拿到初次创建编辑器时页面状态下的state,内部createEditor时能否给onChange包一层ref? ``` useEffect(() => { if (ref.current == null) return if (editor != null) return // 防止重复渲染 当编辑器已经创建就不在创建了 if (ref.current?.getAttribute('data-w-e-textarea')) return const newEditor = createEditor({ selector: ref.current, config: { ...defaultConfig,...
https://cloud.tencent.com/developer/article/2094705 https://ant-design.antgroup.com/components/segmented-cn  