A rich text editor base on HTML contenteditable
npm install --save slash-rich-text-editor
import React, { useState } from 'react'
import EditablePage, { BlockModel } from 'slash-rich-text-editor'
import 'slash-rich-text-editor/dist/index.css'
const Example = () => {
const [value, setValue] = useState<BlockModel[]>([
{ id: 'default', html: 'Default paragraph', tag: 'p' }
])
return (
<EditablePage
value={value}
onChange={(result: BlockModel[]) => setValue(result)}
/>
)
}
MIT © maiducthang279