Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ...
- _onClick = (e) => {
- this.onChange(RichUtils.toggleInlineStyle(this.state.editorState, e.target.name));
- }
- render() {
- const styles = ['BOLD', 'ITALIC', 'UNDERLINE', 'CODE'];
- const buttons = styles.map(style => {
- return <button key={style} onClick={this._onClick} name={style}>{style}</button>
- })
- return (
- <div className="App">
- <h1>My Editor</h1>
- <div className='toolbar'>
- {buttons}
- </div>
- //...
- </div>
- )
- };
Add Comment
Please, Sign In to add comment