Skip to content

Commit

Permalink
Updated toolbar module example for ES6 and React Component syntax (ze…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyguy160 authored and alexkrolick committed Oct 16, 2018
1 parent 0ac07bd commit 9be8dc6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,15 @@ The [Quill Toolbar Module](http://quilljs.com/docs/modules/toolbar/) API provide
<summary>Example Code</summary>

```jsx
var MyComponent = React.createClass({
class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
text: "",
}
}

modules: {
modules = {
toolbar: [
[{ 'header': [1, 2, false] }],
['bold', 'italic', 'underline','strike', 'blockquote'],
Expand All @@ -160,14 +166,14 @@ var MyComponent = React.createClass({
],
},

formats: [
formats = [
'header',
'bold', 'italic', 'underline', 'strike', 'blockquote',
'list', 'bullet', 'indent',
'link', 'image'
],

render: function() {
render() {
return (
<div className="text-editor">
<ReactQuill theme="snow"
Expand All @@ -176,9 +182,10 @@ var MyComponent = React.createClass({
</ReactQuill>
</div>
);
},
}
}

});
export default MyComponent;
```

</details>
Expand Down

0 comments on commit 9be8dc6

Please sign in to comment.