2
私は解決に苦しんでいる範囲の問題があります。React.createClass内のスコープの問題
私はgetTrackNotesをes6モジュールにインポートします。これはReactクラス内で以下のように参照しますが、これはトラック(リアクションクラス)に設定されています。
どうすればいいですか?
import { getTrackNotes } from '../utils/immutableInstruments';
const Track = React.createClass({
componentDidMount() {
const { trackId } = this.props.params;
function updateTimeSequencer (socket, state, getTrackNotes, TimeSequencer, instruments, trackId)
{
//I want to call getTrackNotes here, but the scope is set to the Track React class
**getTrackNotes();**
}
var instruments = this.props.instruments;
socket.on('state', updateTimeSequencer.bind(this, socket));
}
ああ、私は地獄が起こっていたかと思った、私はその感謝を試してみましょう – iKode