Fixed Slate error by providing initial value

This commit is contained in:
t1enne
2022-05-18 08:16:46 +02:00
parent 0bf1c7ce48
commit 1b9c04210b

View File

@ -144,7 +144,11 @@ export default function ChatTextField(props: Props) {
return (
<div className={s.root}>
<Slate editor={editor} value={[]} onChange={handleChange}>
<Slate
editor={editor}
value={[{ type: 'paragraph', children: [{ text: '' }] }]}
onChange={handleChange}
>
<Editable
onKeyDown={onKeyDown}
renderElement={p => <Element {...p} />}