Anudeep GI
Anudeep GI

Reputation: 941

Mobx-react console warning related observer

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

Upvotes: 3

Views: 4482

Answers (1)

Ivan V.
Ivan V.

Reputation: 8081

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'

Upvotes: 10

Related Questions