在React里使用ckeditor遇到问题,有没有react里用过ckeditor的帮忙解答一下?
用npm安装package: npm install ckeditor
在component里,使用ckeditor:
import CKEDITOR from 'ckeditor';
componentDidMount() {
CKEDITOR.replace( 'editor1' );
}
这是我的textarea:
<textarea ref="editor1" id="editor1" rows="10" cols="80"/>
每次都得到这个报错:
Uncaught TypeError: _ckeditor2.default.replace is not a function