rememberSpellCheckState
fun rememberSpellCheckState(spellChecker: EditorSpellChecker?, initialText: AnnotatedString? = null, enableSpellChecking: Boolean = true, spellCheckMode: SpellCheckMode = SpellCheckMode.Word): SpellCheckState(source)
Remembers a SpellCheckState for the editor.
Pass a STABLE spellChecker instance — remember it across recompositions and only create a new one when the underlying dictionary actually changes. A fresh instance every recomposition re-keys the full-rescan effect below and re-scans the whole document on each frame. (Re-scans are cancellation-safe and won't lose spans, but the churn is pure waste.)