No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

22 líneas
696 B

  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow strict-local
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type ContentState from "./ContentState";
  13. import type DraftEntityInstance from "./DraftEntityInstance";
  14. const addEntityToEntityMap = require("./addEntityToEntityMap");
  15. function addEntityToContentState(contentState: ContentState, instance: DraftEntityInstance): ContentState {
  16. return contentState.set('entityMap', addEntityToEntityMap(contentState.getEntityMap(), instance));
  17. }
  18. module.exports = addEntityToContentState;