-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[email protected]
observer not triggering component re-renders
#3671
Comments
|
@imjordanxd What version of mobx-react works for you? Because I think I'm seeing this same issue with mobx-react 8.0.0. |
The sandbox provided in the issue also fails using the observer from mobx-react 8.0.0 but works using mobx-react 7.6.0. No doubt same root cause as in [email protected]. |
If you turn off StrictMode, then the update works. |
I noticed that the update is working with strict mode, but only in the Production build. Most likely the problem with compatibility with the DEV mode in React Working configuration:
non -working configuration:
|
I identified the cause, but the fix seems to be non-trivial atm. The problem can also appear outside StrictMode (probably only when using concurrent features or when FinalizationRegistry isn't available), WIP PR #3673 |
@urugator should we unpublish this major mobx-react / mobx-react-lite to avoid people taking it in production unawares until fixed? |
@mweststrate Yea, probably. Atm I can provide a "fix", where everything basically works, bot not as intended - it won't use a global state version - however it's actually NOT using global version even now, because there was a pretty stupid typo: |
Found the problem - observable |
mobx-react v8.0.0 broke my apps. I wrap my app in |
Yeah will unpublished when I'm behind a keyboard again
…On Wed, 29 Mar 2023, 02:08 evoyy, ***@***.***> wrote:
mobx-react v8.0.0 broke my apps. I wrap my app in StrictMode in
development. If I remove StrictMode, it all works again. I already pushed
another app to production but StrictMode is disabled in production so I
dodged a bullet there.
—
Reply to this email directly, view it on GitHub
<#3671 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBC7TGYAN7QXVSB7DTTW6N4RFANCNFSM6AAAAAAWJZWIM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Reverted |
Has this issue been resolved? I'm waiting so long. |
We reverted the 4.x release, we'll release it again, but needs some more
time. For now stick to 3.x
…On Wed, 26 Apr 2023, 09:33 YoungSeon.Ahn, ***@***.***> wrote:
Has this issue been resolved? I'm waiting so long.
—
Reply to this email directly, view it on GitHub
<#3671 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBEX2FUD6RWMYHFVOUTXDDFUXANCNFSM6AAAAAAWJZWIM4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Should be fixed by mobx-react@9. Thanks for the patience! |
is it fixed? @mweststrate in |
Is it fixed? |
@wuzinong Feel free to create a separate issue with a reproduction. No need to bump old issues |
The
observer
ofmobx-react-lite
seems to not trigger the wrapped component to re-renders after upgrading from[email protected]
to[email protected]
.Intended outcome:
When an
observable
value changes in the store, theobserver
component should re-render with the new value.Actual outcome:
The
observer
component does not re-render when theobservable
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 from4.0.2
to3.4.3
in the sandbox, the component will re-render when you click the "Push new element to data" button.Versions
[email protected]
The text was updated successfully, but these errors were encountered: