A Block Editor Is Not Just a Text Field

https://hackernoon.imgix.net/images/5JWQSrHuzQScjyXZiIw3kX1y8LV2-zk83bh5.png

A block editor Is a document editor

The textbook Compose text-input pattern is clean on a whiteboard: keep the document in immutable state, feed the current value into a remembered TextFieldState, and push edits back through callbacks. For ordinary input, that model is fine. It breaks the moment Enter stops meaning insert a newline and starts meaning split this block, preserve formatting, and keep the document valid for serialization.

The document is an ordered list of structural units — paragraphs, headings, quotes, todos, list items, dividers — closer to Notion than to a single rich-text field. Each block has its own identity, lifecycle, and serialization rules. Some gestures are still local text edits; many are document operations expressed through a text UI. Enter may split a block. Pressing Backspace at the start of a block may mean merge two blocks and reconcile their text, spans, and caret. Converting...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE