1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-09 16:56:36 +02:00

Update 09-serializing.md (#4159)

This is a typo in the docs. You can't have `children` be a `const` because inside the `if` block you change it. It needs to be defined as let, or else it doesn't work.
This commit is contained in:
Stefan Kupresak
2021-04-01 18:45:24 +02:00
committed by GitHub
parent 50489b6bc7
commit 0f8b5cfa2e

View File

@@ -169,7 +169,7 @@ const deserialize = el => {
return null
}
const children = Array.from(el.childNodes).map(deserialize)
let children = Array.from(el.childNodes).map(deserialize)
if (children.length === 0) {
children = [{ text: '' }]