-
-
Notifications
You must be signed in to change notification settings - Fork 90
need support case of 'parent / childs render in the right order' #191
Comments
Well, those tests were basically copied over from |
@FredyC my use case is same with the test. when logout, user data become null, and the components use user data which only render when login and control by parent get error. |
Sorry, I am not sure I follow. That test is somewhat weirdly written and doesn't make much sense to me. I tried to simplify it and it seems to be working. Please tweak that sandbox to reproduce your specific issue. |
@snadn for verification purposes, you could check if the problem disappears when using observer through mobx-react (mobx-react repackages mobx-react-lite + more goodies, so the rest of the impl will stay the same) Please note that this issue is a duplicate of #153, so most probably not fixed yet . As work around, doing the following in your app code before rendering React for the first time should also fix it: import { configure } from "mobx"
import { unstable_batchedUpdates } from "react-dom" // or react-native
configure({ reactionScheduler: unstable_batchedUpdates }) |
@mweststrate thanks, I will check later. I use mobx-react and mobx-react-lite in my project. I came across this problem when I use mobx-react-lite, and no problem when use mobx-react. |
@FredyC I reproduced this problem with mobx@4.13.0 mobx-react-lite@1.4.1 and async action. @mweststrate and import { unstable_batchedUpdates } from "react-dom"; // or react-native
mobx.configure({ reactionScheduler: unstable_batchedUpdates }); fix it |
Ok, thanks for repro, that confirms it's indeed duplicate of #153 so closing here. |
I need to send a request to the server before logout |
Without the setTimeout you'll leverage the react batch that one gets for
free by using react event handlers, so it is correct that that "fixes" the
issue.
Op ma 5 aug. 2019 07:33 schreef snadn <notifications@github.com>:
… I need to send a request to the server before logout
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#191?email_source=notifications&email_token=AAN4NBEZMODDDL5BGYXKQO3QC63SLA5CNFSM4II3C4LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3QXIKA#issuecomment-518091816>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN4NBCBOXY57YB4KHW5OOLQC63SLANCNFSM4II3C4LA>
.
|
is there any plan to support case of 'parent / childs render in the right order' https://github.com/mobxjs/mobx-react-lite/blob/master/test/observer.test.tsx#L600
The text was updated successfully, but these errors were encountered: