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:
@@ -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: '' }]
|
||||
|
Reference in New Issue
Block a user