Skip to content
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

AppState loading never used #1

Open
TuningGuide opened this issue Aug 9, 2016 · 2 comments
Open

AppState loading never used #1

TuningGuide opened this issue Aug 9, 2016 · 2 comments

Comments

@TuningGuide
Copy link

Hi thanks for you tut. I wonder if manipulating the state in class LoginPage this.setState({loading: true}); is good practice with mobx. I would assume so, as you handle the state completely within the component. But then you don't need the AppState loading property right?

@philolo1
Copy link
Owner

philolo1 commented Aug 9, 2016

Hi, yes I think i initially i used the appState loading, but for some reason i changed it to a normal state. I think you can do everything with mobX. I will look again what was the reason for it.

@philolo1
Copy link
Owner

philolo1 commented Aug 9, 2016

So the reason is that this is renderModal is a function and mobX cannot determine the depency to loading so it would not rerender automatically in this case. So i use a normal setState to trigger rerendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants