rememberRichTextState

fun rememberRichTextState(initialText: <Error class: unknown class> = RichString("")): RichTextState

Creates and remembers a RichTextState across configuration changes and process death using RichTextState.Saver.

For large document editing where Bundle size limits (TransactionTooLargeException) are a concern, or where undo/redo history must survive configuration changes, hoist RichTextState directly in a ViewModel instead of using rememberRichTextState.

Parameters

initialText

The initial RichString to populate the editor state with. Defaults to empty.


fun rememberRichTextState(initialText: <Error class: unknown class> = RichString(""), saver: Saver<RichTextState, *>): RichTextState

Creates and remembers a RichTextState with a custom saver (e.g. supporting custom attribute keys).

Parameters

initialText

The initial RichString to populate the editor state with. Defaults to empty.

saver

The custom Saver to use for saving and restoring the RichTextState.