【问题标题】:Mobx Out of bounds read: 2 - React-NativeMobx 越界读取:2 - React-Native
【发布时间】:2022-12-17 08:03:40
【问题描述】:

我在我的 React-native 应用程序中使用我的 mobx。

mobx: "^6.6.2",mobx-react-lite: "^3.4.0",

mobxStore.js

this.arr = [];

getArray(){
   return this.arr;
}


const temp = appState.getArray();

获取状态数组时,我多次收到此警告。

想从 mobx 中删除此多行警告。 感谢您的进一步支持。

【问题讨论】:

    标签: arrays react-native mobx mobx-react-lite


    【解决方案1】:

    很多天以来我一直收到此错误并进行了很多搜索以删除此警告,最后我找到了解决方案,我们开始吧。

    const temp = appState.getArray().slice();
    

    要么

    const temp = appState.arr.slice();
    

    这个片()功能将全部删除。

    【讨论】:

      猜你喜欢
      • 2022-06-24
      • 1970-01-01
      • 2018-07-28
      • 1970-01-01
      • 2019-12-24
      • 1970-01-01
      • 1970-01-01
      • 2018-06-20
      • 1970-01-01
      相关资源
      最近更新 更多