3

Im getting below warning when I tried to run my react code, I have run 'npm run eject' and update package.js for making decorator work in react, it is working fine but Im getting below warning in console

[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 = "";
}

above is my code, Im new to mobx and react

Anudeep GI
  • 931
  • 3
  • 14
  • 45

1 Answers1

10

There are some edge cases in regards to update order of parent-child components. try adding this to the file.

import 'mobx-react-lite/batchingForReactDom'
Ivan V.
  • 7,593
  • 2
  • 36
  • 53