UNPKG

draft-js-modifiers

Version:
8 lines (6 loc) 374 B
import { EditorState } from 'draft-js'; var mergeEntityData = function mergeEntityData(editorState, entityKey, data) { var newContentState = editorState.getCurrentContent().mergeEntityData(entityKey, data); return EditorState.forceSelection(EditorState.push(editorState, newContentState, 'apply-entity'), editorState.getSelection()); }; export default mergeEntityData;