draft-js-test

1.0.1 • Public • Published

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));
}

===

/draft-js-test/

    Package Sidebar

    Install

    npm i draft-js-test

    Weekly Downloads

    4

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    32.2 kB

    Total Files

    7

    Last publish

    Collaborators

    • sykim1009