Hello, this is to be considered a feature request more than a bug.
Current version of react-quill doesn't work on a Preact environment (https://preactjs.com/)
Would it be possible to test and see what Preact is missing or react-quill is missing to make this work together? Thanks.
Looks like Preact is having issues with Mixins https://github.com/developit/preact-compat/issues/442
At some point the mixin and toolbar will be deprecated in favor of an ES6 rewrite. It'll be a breaking change but we can make sure it works with Preact at that point.
If you don't need the full declarative wrapper provided by React-Quill, you can create a "lite version" that simply instantiates Quill in a (P)React-provided DOM element like this:
/** @jsx h */
import { h, Component } from 'preact'
import { PropTypes } from 'react'
import Quill from 'quill'
class Editor extends Component {
editorRef = null
componentDidMount () {
if (!this.editorRef) return;
this.editor = new Quill(this.editorRef, {
theme: this.props.theme,
placeholder: this.props.placeholder,
})
// hook up change handlers...
}
shouldComponentUpdate (nextProps, nextState) {
return false
}
render () {
return <div ref={el => { this.editorRef = el }}/>
}
}
Editor.propTypes = {
placeholder: PropTypes.string,
theme: PropTypes.oneOf(['snow', 'bubble']),
onChange: PropTypes.func(),
}
Editor.defaultProps = {
placeholder: '',
theme: 'snow',
}
export default Editor
https://github.com/alexkrolick/electron-quill/blob/master/app/editor.jsx
This is exactly what I need. Thank you very much. Feel free to close this issue if the ES6 migration is being tracked somewhere else.
Most helpful comment
If you don't need the full declarative wrapper provided by React-Quill, you can create a "lite version" that simply instantiates Quill in a (P)React-provided DOM element like this:
https://github.com/alexkrolick/electron-quill/blob/master/app/editor.jsx