2017-02-08 9 views
1

私はReactJSの初心者です。私はReactJS ES6を使ってプロジェクトをやっています。私のプロジェクトでは、Froala Editorを使用しています。完全に動作します。しかし、今、私は新しい機能がFroalaエディタが入力テキスト、テキストエリアを追加する必要があるので、Froalaはより多くの設定を必要とします。私はReactJSコンポーネントにどこに配置するか分かりません。ここに私のReactコンポーネントがあります。私はこのようなconfigの場合は、コンソールは「未定義のプロパティ 『DefineIcon』を読み取ることができません」というエラーメッセージが表示されますフアララエディタ設定でJS ES6に反応する

import FroalaEditor from 'react-froala-wysiwyg' 
import FroalaEditorView from 'react-froala-wysiwyg/FroalaEditorView' 

class RequestFormComponent extends Component { 
    constructor(props) { 
     super(props); 

     this.handleModelChange = this.handleModelChange.bind(this); 
     $.FroalaEditor.DefineIcon('insertInputField', {NAME: 'plus'}); 
     $.FroalaEditor.RegisterCommand('insertInputField', { 
      title: 'Insert InputField', 
      focus: true, 
      undo: true, 
      refreshAfterCallback: true, 
      callback: function() { 
       this.html.insert(some input text); 
      } 
     }); 

     this.state = this._getState(); 
    } 

    _getState() { 
     return { 
      content: "Some text", 
      config: { 
       toolbarButtons: ['undo', 'redo', 'clearFormatting', 'selectAll', 'html', 'insertInputField'] 
      } 
     } 
    } 

    handleModelChange(model) { 
     this.setState({content: model}); 
    } 
    render() { 
     return (
      <FroalaEditor 
       model={this.state.content} 
       onModelChange={this.handleModelChange} 
       config = {this.state.config} 
      /> 
     ) 
    } 

は、私は多くのことを研究したが、何も得ませんでした。 この問題を解決するためのアドバイスをお願いします。

答えて

0

私はあなたがjqueryのをインポートする必要があると思う:

import $ from 'jquery';

関連する問題