Mobx-React: Rootstore with child stores and async validation at init #2656
Unanswered
sptGabriel
asked this question in
General
Replies: 2 comments 2 replies
-
Make sure you read the migration guide closely. Just glancing I don't see |
Beta Was this translation helpful? Give feedback.
1 reply
-
And if you can help me with one more question, every time I enter the page I get my user, (the current user logged in) from my api, but I wanted that every time my currentUser suffered a change, I wanted modify the value of my isAuth in another store, the most correct for that would be the reaction? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello I have a problem getting a property value from a store in my rootStore, and showing the value in jsx.
the logic:
When I start I check if there is a cookie, if it exists I do a fetching with my api to load the current user.
I created a sandbox to simulate and esotu with the same problem with async:
https://codesandbox.io/s/hungry-buck-jrkte?file=/src/App.tsx
Provider:
RootStore:
CurrentUserStore: // here i check cookie and getUser from my api
AuthStore: // Here I need to hear my currentUser, to make isAuth false or true
on componentwillmount:
sorry if it's not the right place to ask, but i've tried everything, i followed the tutorial, but without success
Beta Was this translation helpful? Give feedback.
All reactions