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

How can I save redux state in onExit static function? #2810

Closed
chinavane opened this issue Jan 19, 2018 · 4 comments
Closed

How can I save redux state in onExit static function? #2810

chinavane opened this issue Jan 19, 2018 · 4 comments

Comments

@chinavane
Copy link

Because static function can't get this reference,but i want to save data to redux state, what can i do?
static onExit(){
// what can i do anything?
}

@themakerman
Copy link

@chinavane Can you explain the actual scenario you want? Do you want to save redux state so that when you reopen the app the data comes back again?

@chinavane
Copy link
Author

When I switch the scene, I will trigger the onExit method. At this time, I want to store some data in redux store, for example, the rolling position of flatlist. But onExit is a static method, and the static method can't get the this object, so it's not good to operate this.state

@afilp
Copy link

afilp commented Feb 7, 2018

I tried to use it with a "connected" component but onExit does not even trigger. Is this normal?

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
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

4 participants