Mobx-react console warning related observer

Viewed 4143

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

1 Answers

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'
Related