facebookarchive/draft-js

Why is createEntity mutable?

Open

#1.256 aberto em 21 de jun. de 2017

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)JavaScript (2.646 forks)batch import
documentationhelp wanted

Métricas do repositório

Stars
 (22.554 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Do you want to request a feature or report a bug? Question/bug

What is the current behavior? Calling contentState.createEntity actually modifies contentState object instead of just returning a new one. Here is a simple fiddle: https://jsfiddle.net/FredyCr/32vo35tk/2/

What is the expected behavior? I guess it's not a big deal, it's just little bit confusing given that almost every other operation is immutable.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? Working with the latest 0.10.1, not sure about previous versions.

Guia do colaborador