fintory / boot-next

Basic Next.js starter kit including the use of TypeScript, styled-components, mobx-state-tree and many more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Value from `mobx-state-tree` not updated on the UI

visualcookie opened this issue · comments

Description

While using useObserver in the _app.tsx, the state doesn't get updated on the UI after the action is called.

commented

Just leaving this here for tomorrow: http://mobx-store-provider.overfoc.us/

According to the docs you have to assign the new state in the action like this:

...
.actions((self) => ({
  increaseByOneDay() {
    self.currentDate = self.currentDate.setDate(
      self.currentDate.getDate() + 1
    )
  },