我在MobX使用數組有點失落,MobX不會訪問數組值
我試圖訪問陣列的價值,並用它做什麼,但它的作用非常怪異。
例如:
console.log('arr arr', this.props.arr) // ["test1, "test2", "test3"]
console.log('arr arr', Array.isArray(this.props.arr)) // true
console.log('arr arr', this.props.arr.length) // 0 (?!?)
所以我不能映射我的陣列,我不能遍歷我的數組,這是完全無用的。
我在.slice
和.replace
處理過這個問題的同一主題,我看到了一些問題,但這也沒有幫助。
,如果你需要我,我可以添加代碼的其餘部分
這非常有趣。你能否添加其餘的代碼? – Tholle