2017-04-27 7 views
1
<SettingsDropdown labelName="Settings" items={[ 
    {name:'Feature Listing', handler:{this.handle_dropdown_featureListing}, divider:true} 
]}/> 

上記の構文で何が問題になっていますか?jsx予期しないトークンがオブジェクトの配列を渡す

私は

handle_dropdown_featureListing =() => { //something }を持っていますが、私はまだ予期しないトークンエラーが発生しました。

答えて

1
handler:{this.handle_dropdown_featureListing} 

ここでは、キーを持たないオブジェクトリテラルがあります。

それはあなたが必要

handler:{keyName: this.handle_dropdown_featureListing} 

または任意の名前でなければなりません。

それとも、単機能の参照を渡す必要がある場合 - ちょうど削除中括弧:

handler: this.handle_dropdown_featureListing 
関連する問題