Closed
Description
Hi I tried to use AllowEditor with React but I have errors in my browser console.
Cannot read property 'add' of undefined
in alloy-editor-no-react.js:12062
Cannot set property 'dir' of undefined
in alloy-editor-no-react.js:237
I read I maybe have to to redefine window.ALLOYEDITOR_BASEPATH and AlloyEditor.regexBasePath but I don't know exactly what to write.
I tried this regex AlloyEditor.regexBasePath = /nodes_modules/alloyeditor/dist/alloy-editor/allow-editor-no-react-min.js/ but it does not work.
My javascript is compiled with webpack and this is the code I use to initialize it :
import "!style!file!css!alloyeditor/dist/alloy-editor/assets/alloy-editor-moono-min.css"
import React, { Component } from "react"
import AlloyEditor from "alloyeditor"
export default class Editor extends Component {
componentDidMount() {
this._editor = AlloyEditor.editable(this.refs.container
}
componentWillUnmount() {
this._editor.destroy()
}
render() {
return (
<div ref="container">
Test
</div>
)
}
}
The initialization seems work because my container is transformed to an content editable component. But I have only a textearea.
Metadata
Metadata
Assignees
Labels
No labels