当我尝试运行我的 react 代码时,我收到了低于警告的信息,我已经运行了“npm run eject”并更新了 package.js 以使装饰器在 react 中工作,它工作正常,但我在控制台中得到低于警告
[MobX] You haven't configured observer batching which might result in unexpected behavior in some cases. See more at https://github.com/mobxjs/mobx-react-lite/#observer-batching
import { observable, computed, action, when } from 'mobx';
class TodoStore {
@observable todos = [];
@observable filter = "";
}
以上是我的代码,我是 mobx 的新手并使用react
最佳答案
关于父子组件的更新顺序,存在一些边缘情况。
尝试将其添加到文件中。
import 'mobx-react-lite/batchingForReactDom'
关于reactjs - Mobx-react 控制台警告相关观察者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61654633/