How to limit Max Length of Draft js
问题 How to limit max characters in draft js? I can get length of the state like that, but how to stop updating component? var length = editorState.getCurrentContent().getPlainText('').length; 回答1: You should define handleBeforeInput and handlePastedText props. In handler-functions, you check the length of current content + length of pasted text and if it reaches the maximum you should return 'handled' string. UPD 21.03.2018: Upgraded to the last versions of react/react-dom (16.2.0) and Draft.js