#2038·draft-js

contentState.getEntityMap() doesn't return an ordered immutable map

Author: folkjcCreated Mar 19, 2019Updated Oct 27, 2022
Labelsbugv0-11-beta

Do you want to request a feature or report a bug? Bug. What is the current behavior? const entityMap = contentState.getEntityMap() entityMap .map((val, key) => console.log(val, key) )

returns the error message: entityMap.map() is not a function.

Similar issue as this: https://github.com/facebook/draft-js/issues/1264

It was closed, but it still occurs

image image

What is the expected behavior? contentState.getEntityMap() is supposed to return an ordered map of entities, according to: https://draftjs.org/docs/api-reference-content-state#getentitymap.

Which is then supposed to be iterable as an immutable ordered map.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

Using firefox, Draft.js ^0.11.0-beta

Source: facebookarchive/draft-js