import React, {PureComponent} from 'react';
import SirTrevor from 'sir-trevor';
const editor = new SirTrevor.Editor({
el: document.querySelector('.js-st-instance'),
defaultType: 'Text',
iconUrl: 'build/sir-trevor-icons.svg'
});
class Add extends PureComponent {
render() {
return (
<div>
<textarea class="js-st-instance"></textarea>
</div>
)
}
TypeError: Cannot read property 'nextSibling' of null
...
componentDidMount() {
const { editorArea } = this.refs;
const editor = new SirTrevor.Editor({
el: editorArea,
defaultType: 'Text',
iconUrl: 'build/sir-trevor-icons.svg'
});
}
render() {
return (
<div>
<textarea className="js-st-instance" ref="editorArea"></textarea>
</div>
)
}
...