1.0.1 • Published 4 years ago

draft-js-test v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

draft-js-plus test

가이드

<TestDraftJsPlus />
// KEY BINDING EXAMPLE
onHeaderOne = () => {
    this.onChange(RichUtils.toggleBlockType(this.state.editorState, 'header-one'))
}

onHeaderTwo = () => {
    this.onChange(RichUtils.toggleBlockType(this.state.editorState, 'header-two'))
}

onHeaderThree = () => {
    this.onChange(RichUtils.toggleBlockType(this.state.editorState, 'header-three'))
}

onHeaderFour = () => {
    this.onChange(RichUtils.toggleBlockType(this.state.editorState, 'header-four'))
}

onHeaderFive = () => {
    this.onChange(RichUtils.toggleBlockType(this.state.editorState, 'header-five'))
}

onBold = () => {
    this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, 'BOLD'));
}

onUnderlineClick = () => {
    this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, 'UNDERLINE'));
}

onToggleCode = () => {
    this.onChange(RichUtils.toggleCode(this.state.editorState));
}

onResetStyle = () => {
    this.onChange(RichUtils.tryToRemoveBlockStyle(this.state.editorState));
}

===