• Beta

    Update the value of a string

    Parameters

    • doc: Doc<unknown>

      The document to modify

    • path: Prop[]

      The path to the string to modify

    • newText: string

      The new text to update the value to

    Returns void

    Remarks

    This will calculate a diff between the current value and the new value and then convert that diff into calls to splice. This will produce results which don't merge as well as directly capturing the user input actions, but sometimes it's not possible to capture user input and this is the best you can do.

    This is an experimental API and may change in the future.