2017-03-29 17 views
0

掙扎ImmutableJS ...收到錯誤:Immutable.js - 類型錯誤:要麼(...)toJS不是一個函數

TypeError: this.props.dataTable.get(...).toJS is not a function

與這條線:

let tbodyRows = this.props.dataTable.get('data').toJS(); 

當我做console.log this.props.dataTable.get('data')我得到數組[1],這個數組包含一個單一的數據對象(這是我所期望的)。

回答

0

爲了使用.toJS(),this.props.dataTable.get('data')應返回List(在這種情況下)而不是Array

相關問題