docs/plans/2026-04-07-slate-v2-react-19-2-cleanup.md
Supporting plan. For current queue and roadmap truth, see master-roadmap.md.
Remove the obvious React 18-era compatibility patterns from the current
slate-v2 React surface.
forwardRef chains in slate-react primitives and
EditableText with React 19 ref-prop components.memo(forwardRef(...)) wrapper in TextString.useMemo with lazy useState in the
flagged example.EditableDescendantNode memo is still justified by the huge-document paste
learning, so this batch should not rip out memoization that is benchmark
backed.Editable useLayoutEffect is justified by DOM selection sync and should
not be downgraded just to look newer.editable-text.tsxslate-element.tsxslate-text.tsxslate-placeholder.tsxtext-string.tsxsite/examples/ts/huge-document.tsxEditableDescendantNode memo and Editable layout effects stay.forwardRef surfaces with React 19 ref props in:
slate-element.tsxslate-text.tsxslate-placeholder.tsxeditable-text.tsxmemo(forwardRef(...)) from TextString.useMemo editor construction with lazy useState in the
huge-document example.EditableDescendantNode memoEditable layout effectsyarn workspace slate-react run testyarn exec eslint packages/slate-react/src/components/slate-element.tsx packages/slate-react/src/components/editable-element.tsx packages/slate-react/src/components/slate-text.tsx packages/slate-react/src/components/slate-placeholder.tsx packages/slate-react/src/components/text-string.tsx packages/slate-react/src/components/editable-text.tsx site/examples/ts/huge-document.tsx site/examples/ts/components/index.tsxyarn prettier --check packages/slate-react/src/components/slate-element.tsx packages/slate-react/src/components/slate-text.tsx packages/slate-react/src/components/slate-placeholder.tsx packages/slate-react/src/components/text-string.tsx packages/slate-react/src/components/editable-text.tsx site/examples/ts/huge-document.tsx site/examples/ts/components/index.tsx /Users/zbeyens/git/plate-2/docs/plans/2026-04-07-slate-v2-react-19-2-cleanup.mdrm -f /Users/zbeyens/git/slate-v2/site/tsconfig.example.tsbuildinfo && yarn tsc:examplesROLLUP_PACKAGES=slate-react yarn build:rollupbash ./scripts/run-slate-browser-local.sh 3100 /examples/rich-inline "yarn exec playwright test playwright/integration/examples/rich-inline.test.ts --project=chromium --workers=1 --grep 'release-shaped lifecycle'"bash ./scripts/run-slate-browser-local.sh 3100 /examples/rich-inline "yarn exec playwright test playwright/integration/examples/rich-inline.test.ts playwright/integration/examples/richtext.test.ts --project=chromium --workers=1"yarn build:slate-browser:playwright still emits unrelated pre-existing
slate core type noise outside this cleanup slice. The targeted
slate-react build is green.