facebookarchive/draft-js

Why is createEntity mutable?

开放

#1,256 创建于 2017年6月21日

 (2 条评论) (0 个反应) (0 位负责人)JavaScript (2,646 个派生)batch import
documentationhelp wanted

仓库指标

星标
 (22,554 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南