const currentContent = editorState.getCurrentContent();
const blockMap = currentContent.getBlockMap();
const key = blockMap.last().getKey();
const length = blockMap.last().getLength();
const selection = new SelectionState({
anchorKey: key,
anchorOffset: length,
focusKey: key,
focusOffset: length,
});
const textWithInsert = Modifier.insertText(currentContent, selection, 'text to be inserted', null);
const editorWithInsert = EditorState.push(editorState, textWithInsert, 'insert-characters');
const newEditorState = EditorState.moveSelectionToEnd(editorWithInsert, textWithInsert.getSelectionAfter());
setEditorState(newEditorState);