
Reproduction sandbox: https://codesandbox.io/s/sleepy-butterfly-20bzx
Slate: 0.58.1
Tested on Win 10 x64: Chrome 84 (x64) and Firefox 76 (x64)
I have followed the tutorial and as soon as I click on the input area I get an error Cannot resolve a Slate point from DOM point: [object HTMLDivElement],0
Not throwing an error.
I am going to close this issue because I am now convinced that Slate is just meant to not work unless you provide a non-empty, semantically correct value. I think it's wrong that the tutorial does not acknowledge that, it seems obvious to me that [] should be a valid content. But it seems it works the way it does.
Yes, as is, it is intended that the default value contain at least one selectable text region to house selection. I'm pretty sure all of the examples have this as a default value but it's probably true that they don't explicitly explain this.
To have it accept [], the editor would need to normalize the content to add the text nodes in there for the user, which would result in an automatic onChange firing immediately, and I'm unsure whether that's more desirable than just passing something that has a text node.
The other question that probably follows is why doesn't slate formalize what the empty value is? It's because "empty" means something different semantically based on how a user is using their editor. A core philosophy of slate is to have as little decisions made as possible to maximize customization. In the same thread that slate does not have a default block type, it also does not have a default empty state.
We could at a minimum certainly use more documentation in this area.
I hope this illuminated some of the rationale.
Most helpful comment
I am going to close this issue because I am now convinced that Slate is just meant to not work unless you provide a non-empty, semantically correct value. I think it's wrong that the tutorial does not acknowledge that, it seems obvious to me that
[]should be a valid content. But it seems it works the way it does.