MCPcopy Index your code
hub / github.com/SamyPesse/draft-js-code / createWithText

Function createWithText

lib/__tests__/handleKeyCommand.js:6–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4const toPlainText = editorState =>
5 editorState.getCurrentContent().getPlainText();
6const createWithText = text => {
7 const contentState = ContentState.createFromText(text);
8 return EditorState.createWithContent(contentState);
9};
10
11it('should delete indentation on backspace', () => {
12 const initialText = 'hello ';

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected