docs/solutions/logic-errors/2026-04-04-v2-editable-text-primitives-should-compose-leaf-text-zero-width-and-placeholder.md
Even after TextString, SlateText, SlateLeaf, ZeroWidthString, and
SlatePlaceholder existed, the proof surfaces were still assembling the same
composition by hand:
That was one layer too low.
slate-react-v2 now owns an EditableText primitive:
It composes:
SlateTextSlateLeafTextStringZeroWidthStringSlatePlaceholderThe v2 placeholder, inline-edge, void-edge, and matrix proof surfaces now use that one component instead of restating the same branch logic over and over.
At this point the repeated contract was no longer “a few useful helpers.” It was already a minimal text renderer.
If every proof surface still decides for itself how to branch between text, zero-width, and placeholder DOM, then the package primitives exist but the real contract still lives in example files.
EditableText moves that branch logic into the package where it belongs.
For slate-react-v2:
If three or more proof surfaces are copying the same “if text else zero-width plus maybe placeholder” shape, you already have a missing component.