mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-08 22:20:41 +02:00
Update examples in docs, editable voids example (#4925)
* Update examples in docs, editable voids example * Update typescript docs
This commit is contained in:
@@ -9,14 +9,13 @@ import { Button, Icon, Toolbar } from '../components'
|
||||
import { EditableVoidElement } from './custom-types'
|
||||
|
||||
const EditableVoidsExample = () => {
|
||||
const [value, setValue] = useState<Descendant[]>(initialValue)
|
||||
const editor = useMemo(
|
||||
() => withEditableVoids(withHistory(withReact(createEditor()))),
|
||||
[]
|
||||
)
|
||||
|
||||
return (
|
||||
<Slate editor={editor} value={value} onChange={setValue}>
|
||||
<Slate editor={editor} value={initialValue}>
|
||||
<Toolbar>
|
||||
<InsertEditableVoidButton />
|
||||
</Toolbar>
|
||||
|
Reference in New Issue
Block a user