Hi everyone,
I have been trying to add react-quill to my application but for some reason I have not been able to succeed.
I can add the toolbar but it shows up like this:
If I then add theme=“snow” to the component it looks like this:
This is my code at the moment:
import ReactQuill from 'react-quill';
export default class AddSpark extends Component {
constructor(props) {
super(props);
}
_quillModules: {
toolbar: [
[{ 'header': [1, 2, false] }],
['bold', 'italic', 'underline','strike', 'blockquote'],
[{'list': 'ordered'}, {'list': 'bullet'}, {'indent': '-1'}, {'indent': '+1'}],
['link', 'image'],
['clean']
]
/* ... other modules */
}
_quillFormats: [
"header",
"bold", "italic", "underline", "strike", "blockquote",
"list", "bullet", "indent",
"link", "image"
]
}
and my quill component:
<ControlLabel>Content</ControlLabel>
<div className='_quill'>
<ReactQuill
theme= 'snow'
value={this.state.value}
modules={this._quillModules}
formats={this._quillFormats}
ref={(input) => this.content = input}>
<div key="editor"
ref="editor"
className="quill-contents border_solid_top"
dangerouslySetInnerHTML={{__html:this.state.editorContent}} />
</ReactQuill>
</div>
I really would love to have a toolbar as we have here, it looks amazing and works just the way I would like mine to work.
Anyone any idea what I am doing wrong?
Cheers,
Dominic