Slate: change the word "state" to "value" everywhere

Created on 23 May 2017  Â·  1Comment  Â·  Source: ianstormtaylor/slate

Open to discussion on this. I initially took the word state from Draft.js, but I think it ends up conflicting with React in confusing ways—both in terms of users understanding what "state" we're referring to, and in terms of naming conflicts for variables in the codebase.

I think value might be nicer, since it mimics native controlled <input> and <textarea> and we could even make editor.value a getter for super easy access. And then setValue is available (right now we can't make our own setState function).

Would do it in a backwards compatible way with deprecations hopefully, so to have the least negative impact when upgrading.

debt idea ✶ breaking

Most helpful comment

I think I might YOLO do this one very soon, since people are only becoming more dependent on the state word if they're serializing stuff to JSON and storing it.

>All comments

I think I might YOLO do this one very soon, since people are only becoming more dependent on the state word if they're serializing stuff to JSON and storing it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JSH3R0 picture JSH3R0  Â·  3Comments

yalu picture yalu  Â·  3Comments

ezakto picture ezakto  Â·  3Comments

Slapbox picture Slapbox  Â·  3Comments

vdms picture vdms  Â·  3Comments