-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
The observer
of mobx-react-lite
seems to not trigger the wrapped component to re-renders after upgrading from mobx-react-lite@3.4.3
to mobx-react-lite@4.0.2
.
Intended outcome:
When an observable
value changes in the store, the observer
component should re-render with the new value.
Actual outcome:
The observer
component does not re-render when the observable
value is updated.
How to reproduce the issue:
Code Sandbox: https://codesandbox.io/s/new-dawn-b2shxq?file=/src/App.js
Clicking "Push new element to data" button will push a new element to the store.data
array using a store action.
However, the component does not re-render even thought store.data
has been updated (see console logs).
If you change the mobx-react-lite
version from 4.0.2
to 3.4.3
in the sandbox, the component will re-render when you click the "Push new element to data" button.
Versions
mobx-react-lite@4.0.2